diff options
author | Vladimir Marko <vmarko@google.com> | 2013-11-25 15:08:02 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2013-11-25 15:52:22 +0000 |
commit | d9cffeaa478bd30ad89a9dfc9680a27ce5efaadf (patch) | |
tree | f7b4760bf715d87da5139db5b08a1af82b567fdf /runtime/dex_file.h | |
parent | 43b971f1dd378e3765b3418c2a0fce55175ceec1 (diff) | |
download | android_art-d9cffeaa478bd30ad89a9dfc9680a27ce5efaadf.tar.gz android_art-d9cffeaa478bd30ad89a9dfc9680a27ce5efaadf.tar.bz2 android_art-d9cffeaa478bd30ad89a9dfc9680a27ce5efaadf.zip |
Faster Signature::operator==(const StringPiece& rhs).
Avoid string allocation and resizing, return early if
a parameter doesn't match.
Change-Id: Ifc929d0c4a7a9d368432f7cae797d4326c6c44be
Diffstat (limited to 'runtime/dex_file.h')
-rw-r--r-- | runtime/dex_file.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/runtime/dex_file.h b/runtime/dex_file.h index 84026a46e6..69593cdffc 100644 --- a/runtime/dex_file.h +++ b/runtime/dex_file.h @@ -964,10 +964,7 @@ class Signature { return !(*this == rhs); } - bool operator==(const StringPiece& rhs) const { - // TODO: Avoid temporary string allocation. - return ToString() == rhs; - } + bool operator==(const StringPiece& rhs) const; private: Signature(const DexFile* dex, const DexFile::ProtoId& proto) : dex_file_(dex), proto_id_(&proto) { |