aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-04-07 11:35:12 +0200
committerGitHub <noreply@github.com>2022-04-07 11:35:12 +0200
commit72cef802467372d51929904d4e7d3f5391b525fe (patch)
treeccef8a7b1d7a23d50d3acb96cd949112afd734b0 /vespajlib/src
parent87b9dcc76a9b33f8b456d53c9aa9e19e89645ee1 (diff)
parentb81d9b9a615ab3e55ff306336e0d98296e9835e1 (diff)
Merge pull request #22013 from vespa-engine/balder/simplify-long-if
Add simplification of long if based on tip from @jonmv.
Diffstat (limited to 'vespajlib/src')
-rw-r--r--vespajlib/src/main/java/com/yahoo/text/Text.java35
1 files changed, 3 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..adf91a9b21e 100644
--- a/vespajlib/src/main/java/com/yahoo/text/Text.java
+++ b/vespajlib/src/main/java/com/yahoo/text/Text.java
@@ -56,38 +56,9 @@ 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 < 0x10000) return true;
+ if (codepoint >= 0x10FFFE) return false;
+ return (codepoint & 0xffff) < 0xFFFE;
}
/**