Use a simple substraction for converting case
[mdsal.git] / model / ietf / ietf-type-util / src / main / java / org / opendaylight / mdsal / model / ietf / util / AbstractIetfYangUtil.java
index aa0bcf4991f11db67d097017411b8075d5408f1e..c43cdcacdaa6c6de5422d8bcd07abc06be4f7adb 100644 (file)
@@ -195,7 +195,8 @@ public abstract class AbstractIetfYangUtil<M, P, H, Q, U> {
         for (int i = 0; i < chars.length; ++i) {
             final char c = chars[i];
             if (c >= 'A' && c <= 'F') {
-                chars[i] = Character.toLowerCase(c);
+                // Weird notation to ensure constant folding to '(char) (c + 32)', a well-known property of ASCII
+                chars[i] = (char) (c + ('a' - 'A'));
                 ret = true;
             }
         }