You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/12/13 23:42:09 UTC

[lucy-commits] svn commit: r1213967 - /incubator/lucy/trunk/core/Lucy/Test/TestUtils.c

Author: marvin
Date: Tue Dec 13 22:42:09 2011
New Revision: 1213967

URL: http://svn.apache.org/viewvc?rev=1213967&view=rev
Log:
Trivial refactoring.

Modified:
    incubator/lucy/trunk/core/Lucy/Test/TestUtils.c

Modified: incubator/lucy/trunk/core/Lucy/Test/TestUtils.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Test/TestUtils.c?rev=1213967&r1=1213966&r2=1213967&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Test/TestUtils.c (original)
+++ incubator/lucy/trunk/core/Lucy/Test/TestUtils.c Tue Dec 13 22:42:09 2011
@@ -100,11 +100,13 @@ S_random_code_point(void) {
                     code_point = (num % (0x10FFFF - 0x10000)) + 0x10000;
                 }
         }
-        if (code_point <= 0xD7FF
-            || (code_point >= 0xE000 && code_point <= 0x10FFFF)
-           ) {
-            break;
+        if (code_point > 0x10FFFF) {
+            continue; // Too high.
         }
+        if (code_point > 0xD7FF && code_point < 0xE000) {
+            continue; // UTF-16 surrogate.
+        }
+        break;
     }
     return code_point;
 }