summaryrefslogtreecommitdiff
path: root/tools/aapt/StringPool.cpp
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2012-03-19 10:48:51 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-03-19 10:48:51 -0700
commit09bea716ec46fabac21a6079a6bd76624ad32cd9 (patch)
tree3b5d5f062611d84cbfb66b4d7037e54aac8b2a75 /tools/aapt/StringPool.cpp
parentf6b8f7b34f5fe94cd1d8753ec356b967293f1f9c (diff)
parent61361f376b47d45966b1ca0d24d51622304c93c3 (diff)
Merge "Add some comments about StringPool sort order."
Diffstat (limited to 'tools/aapt/StringPool.cpp')
-rw-r--r--tools/aapt/StringPool.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/aapt/StringPool.cpp b/tools/aapt/StringPool.cpp
index 46a4c3262b66..963ae59cdb5c 100644
--- a/tools/aapt/StringPool.cpp
+++ b/tools/aapt/StringPool.cpp
@@ -71,14 +71,16 @@ String8 StringPool::entry::makeConfigsString() const {
}
int StringPool::entry::compare(const entry& o) const {
- // Strings with styles go first, to reduce the size of the
- // styles array.
+ // Strings with styles go first, to reduce the size of the styles array.
+ // We don't care about the relative order of these strings.
if (hasStyles) {
return o.hasStyles ? 0 : -1;
}
if (o.hasStyles) {
return 1;
}
+
+ // Sort unstyled strings by type, then by logical configuration.
int comp = configTypeName.compare(o.configTypeName);
if (comp != 0) {
return comp;