Skip to content

Commit 09bea71

Browse files
Jeff BrownAndroid (Google) Code Review
authored andcommitted
Merge "Add some comments about StringPool sort order."
2 parents f6b8f7b + 61361f3 commit 09bea71

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/aapt/StringPool.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,16 @@ String8 StringPool::entry::makeConfigsString() const {
7171
}
7272

7373
int StringPool::entry::compare(const entry& o) const {
74-
// Strings with styles go first, to reduce the size of the
75-
// styles array.
74+
// Strings with styles go first, to reduce the size of the styles array.
75+
// We don't care about the relative order of these strings.
7676
if (hasStyles) {
7777
return o.hasStyles ? 0 : -1;
7878
}
7979
if (o.hasStyles) {
8080
return 1;
8181
}
82+
83+
// Sort unstyled strings by type, then by logical configuration.
8284
int comp = configTypeName.compare(o.configTypeName);
8385
if (comp != 0) {
8486
return comp;

0 commit comments

Comments
 (0)