From: Jeff Brown Date: Fri, 16 Mar 2012 22:25:17 +0000 (-0700) Subject: Add some comments about StringPool sort order. X-Git-Url: https://git.saurik.com/android/aapt.git/commitdiff_plain/af91d419f0fc552d1969b6b7d354fca2bc3e36ed Add some comments about StringPool sort order. Change-Id: I57f24d46328a6bfef883819eaf95c03114d573bb --- diff --git a/StringPool.cpp b/StringPool.cpp index 46a4c32..963ae59 100644 --- a/StringPool.cpp +++ b/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;