From d42692d329264ead9b918971661833bf49c39b96 Mon Sep 17 00:00:00 2001 From: Herb Derby Date: Tue, 18 Jun 2019 16:08:25 -0400 Subject: [PATCH] Cleanup findOrCreateScopedStrike This does not need to repeat the code of the version that returns a Node*. Change-Id: I3c67e3848ba4772cc63b71b78ad29f93fd479956 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221722 Commit-Queue: Herb Derby Commit-Queue: Mike Klein Auto-Submit: Herb Derby Reviewed-by: Mike Klein --- src/core/SkStrikeCache.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/core/SkStrikeCache.cpp b/src/core/SkStrikeCache.cpp index 26d376bdb5..4509d4e0c7 100644 --- a/src/core/SkStrikeCache.cpp +++ b/src/core/SkStrikeCache.cpp @@ -172,12 +172,7 @@ auto SkStrikeCache::findOrCreateStrike(const SkDescriptor& desc, SkScopedStrike SkStrikeCache::findOrCreateScopedStrike(const SkDescriptor& desc, const SkScalerContextEffects& effects, const SkTypeface& typeface) { - Node* node = this->findAndDetachStrike(desc); - if (node == nullptr) { - auto scaler = CreateScalerContext(desc, effects, typeface); - node = this->createStrike(desc, std::move(scaler)); - } - return SkScopedStrike{node}; + return SkScopedStrike{this->findOrCreateStrike(desc, effects, typeface)}; } void SkStrikeCache::PurgeAll() {