Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-08-30 19:40:34 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-08-30 19:40:34 +0300
commit0f3b910c3a69ab557508090ce1dad2ac051d3b00 (patch)
tree3be6bf04b61b9b679a7729e0752093239732af47
parentbed321f6dacb9cee587d1767d4b45b601bbaf529 (diff)
Cleanup: redundant lowercase in BLI_natstrcmp
-rw-r--r--source/blender/blenlib/intern/string.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index 3b69e257f45..c3947cb8158 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -675,10 +675,7 @@ int BLI_natstrcmp(const char *s1, const char *s2)
* numeric, else do a tolower and char compare */
while (1) {
- c1 = tolower(s1[d1]);
- c2 = tolower(s2[d2]);
-
- if (isdigit(c1) && isdigit(c2)) {
+ if (isdigit(s1[d1]) && isdigit(s2[d2])) {
int numcompare = left_number_strcmp(s1 + d1, s2 + d2, &tiebreaker);
if (numcompare != 0) {
@@ -693,11 +690,11 @@ int BLI_natstrcmp(const char *s1, const char *s2)
while (isdigit(s2[d2])) {
d2++;
}
-
- c1 = tolower(s1[d1]);
- c2 = tolower(s2[d2]);
}
+ c1 = tolower(s1[d1]);
+ c2 = tolower(s2[d2]);
+
/* first check for '.' so "foo.bar" comes before "foo 1.bar" */
if (c1 == '.' && c2 != '.') {
return -1;