ui/shared/src/main/java/com/squareup/subzero/shared/Base45.java
protected static Integer indexOf(char c) {
    // The map needs to be initialized in a thread-safe way.
    synchronized (lock) {
      if (REVERSE_CHARSET == null) {
        HashMap<Character, Integer> map = new HashMap<>(45);
        for (int i = 0; i < 45; i++) {
          map.put(CHARSET.charAt(i), i);
        }
        REVERSE_CHARSET = ImmutableMap.copyOf(map);
      }
    }
    return REVERSE_CHARSET.get(c);
  }
/**
   * Fast reverse lookup using ImmutableMap.
   */
Fast reverse lookup using ImmutableMap.
Fast reverse lookup using ImmutableMap .
protected static Integer indexOf(char c) {
    synchronized (lock) {
      if (REVERSE_CHARSET == null) {
        HashMap<Character, Integer> map = new HashMap<>(45);
        for (int i = 0; i < 45; i++) {
          map.put(CHARSET.charAt(i), i);
        }
        REVERSE_CHARSET = ImmutableMap.copyOf(map);
      }
    }
    return REVERSE_CHARSET.get(c);
  }
protected static Integer indexOf ( char c ) { synchronized ( lock ) { if ( REVERSE_CHARSET == null ) { HashMap < Character , Integer > map = new HashMap < > ( 45 ) ; for ( int i = 0 ; i < 45 ; i ++ ) { map . put ( CHARSET . charAt ( i ) , i ) ; } REVERSE_CHARSET = ImmutableMap . copyOf ( map ) ; } } return REVERSE_CHARSET . get ( c ) ; }
Fast reverse lookup using ImmutableMap.
Fast reverse lookup using ImmutableMap .
// The map needs to be initialized in a thread-safe way.