[svn:parrot] r46001 - trunk/src/string
petdance at svn.parrot.org
petdance at svn.parrot.org
Sun Apr 25 02:44:35 UTC 2010
Author: petdance
Date: Sun Apr 25 02:44:35 2010
New Revision: 46001
URL: https://trac.parrot.org/parrot/changeset/46001
Log:
COMPARE funcs are not booleans. strlen is not boolean, either. add clarifying parentheses
Modified:
trunk/src/string/api.c
Modified: trunk/src/string/api.c
==============================================================================
--- trunk/src/string/api.c Sun Apr 25 02:29:44 2010 (r46000)
+++ trunk/src/string/api.c Sun Apr 25 02:44:35 2010 (r46001)
@@ -1368,15 +1368,15 @@
/* we don't care which is bigger */
else if (s1->strlen != s2->strlen)
return 0;
- else if (s1->hashval != s2->hashval && s1->hashval && s2->hashval)
+ else if ((s1->hashval != s2->hashval) && s1->hashval && s2->hashval)
return 0;
/* s2->strlen is the same here */
- else if (!s1->strlen)
+ else if (s1->strlen == 0)
return 1;
/* COWed strings */
- else if (s1->strstart == s2->strstart && s1->bufused == s2->bufused)
+ else if ((s1->strstart == s2->strstart) && (s1->bufused == s2->bufused))
return 1;
/*
@@ -1384,7 +1384,7 @@
* both strings are non-null
* both strings have same length
*/
- return !CHARSET_COMPARE(interp, s1, s2);
+ return CHARSET_COMPARE(interp, s1, s2) == 0;
}
More information about the parrot-commits
mailing list