aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-04-06 22:00:20 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2022-04-06 22:07:46 +0200
commit31b3ee8a8d4853855891a1432c1e4eb8c38c7c8d (patch)
tree128c43a339ed9e8f283ea96abdbfcc1119860adf /vespajlib
parentf92bc8abaf011a2540a19a64997a3f1d920ad07f (diff)
Add simplification of long if based on tip from @jonmv.
Diffstat (limited to 'vespajlib')
-rw-r--r--vespajlib/src/main/java/com/yahoo/text/Text.java34
1 files changed, 2 insertions, 32 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/text/Text.java b/vespajlib/src/main/java/com/yahoo/text/Text.java
index d1712a20626..b0a3df4d20c 100644
--- a/vespajlib/src/main/java/com/yahoo/text/Text.java
+++ b/vespajlib/src/main/java/com/yahoo/text/Text.java
@@ -56,38 +56,8 @@ public final class Text {
if (codepoint <= Character.MAX_HIGH_SURROGATE) return false;
if (codepoint < 0xFDD0) return true;
if (codepoint <= 0xFDDF) return false;
- if (codepoint < 0x1FFFE) return true;
- if (codepoint <= 0x1FFFF) return false;
- if (codepoint < 0x2FFFE) return true;
- if (codepoint <= 0x2FFFF) return false;
- if (codepoint < 0x3FFFE) return true;
- if (codepoint <= 0x3FFFF) return false;
- if (codepoint < 0x4FFFE) return true;
- if (codepoint <= 0x4FFFF) return false;
- if (codepoint < 0x5FFFE) return true;
- if (codepoint <= 0x5FFFF) return false;
- if (codepoint < 0x6FFFE) return true;
- if (codepoint <= 0x6FFFF) return false;
- if (codepoint < 0x7FFFE) return true;
- if (codepoint <= 0x7FFFF) return false;
- if (codepoint < 0x8FFFE) return true;
- if (codepoint <= 0x8FFFF) return false;
- if (codepoint < 0x9FFFE) return true;
- if (codepoint <= 0x9FFFF) return false;
- if (codepoint < 0xAFFFE) return true;
- if (codepoint <= 0xAFFFF) return false;
- if (codepoint < 0xBFFFE) return true;
- if (codepoint <= 0xBFFFF) return false;
- if (codepoint < 0xCFFFE) return true;
- if (codepoint <= 0xCFFFF) return false;
- if (codepoint < 0xDFFFE) return true;
- if (codepoint <= 0xDFFFF) return false;
- if (codepoint < 0xEFFFE) return true;
- if (codepoint <= 0xEFFFF) return false;
- if (codepoint < 0xFFFFE) return true;
- if (codepoint <= 0xFFFFF) return false;
- if (codepoint < 0x10FFFE) return true;
- return false;
+ if (codepoint >= 0x10FFFE) return false;
+ return (codepoint & 0xffff) < 0xFFFE;
}
/**