Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1309)

Unified Diff: src/core/SkPictureRecord.cpp

Issue 550043003: Remove a linear search in SkPictureRecord::addTextBlob. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureRecord.cpp
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index a6b6f613933daba03dd0a8dc1a57ba3db5c1dbd2..b17169183a1a71bd41fde3e8c22ba352f78d3f68 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -1544,12 +1544,9 @@ void SkPictureRecord::addText(const void* text, size_t byteLength) {
}
void SkPictureRecord::addTextBlob(const SkTextBlob *blob) {
- int index = fTextBlobRefs.find(blob);
- if (index < 0) { // not found
- index = fTextBlobRefs.count();
- *fTextBlobRefs.append() = blob;
- blob->ref();
- }
+ int index = fTextBlobRefs.count();
+ *fTextBlobRefs.append() = blob;
+ blob->ref();
// follow the convention of recording a 1-based index
this->addInt(index + 1);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698