summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2017-01-26 14:21:00 -0800
committerDylan Baker <dylan@pnwbakers.com>2017-01-27 10:34:45 -0800
commit514795d2ec9773b8a66cfdfaede3af0d49ad92b7 (patch)
tree77c0b1d76f859d8cd7331171c6c4fdd5532d9ba4 /tests
parentbef724a5d142a1ca06476d56015a6c6bcdf89f1b (diff)
widgets/globals: Optimize sorting TagWidgets
The calculation wants to sort first by length, then by string value (so 'z' would come before 'aa'). The calculation does this by deciding that if one value has a length of 1, and the other doesn't. Currently it does this by calling min, and max, and calling len 4 times. This is pretty inefficient, and more complicated that necessary. Instead, this patch uses 'is not' with booleans to figure out if one and only one of the lengths is 1.
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions