1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
public final class Options extends AbstractList implements RandomAccess { @NotNull public static final Companion Companion = new Companion((DefaultConstructorMarker)null);
@JvmStatic @NotNull public static final Options of(@NotNull ByteString... byteStrings) { return Companion.of(byteStrings); }
@Metadata( mv = {1, 5, 1}, k = 1, xi = 48, d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0010\u0011\n\u0002\b\u0002\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002JT\u0010\b\u001a\u00020\t2\b\b\u0002\u0010\n\u001a\u00020\u00042\u0006\u0010\u000b\u001a\u00020\u00052\b\b\u0002\u0010\f\u001a\u00020\r2\f\u0010\u000e\u001a\b\u0012\u0004\u0012\u00020\u00100\u000f2\b\b\u0002\u0010\u0011\u001a\u00020\r2\b\b\u0002\u0010\u0012\u001a\u00020\r2\f\u0010\u0013\u001a\b\u0012\u0004\u0012\u00020\r0\u000fH\u0002J!\u0010\u0014\u001a\u00020\u00152\u0012\u0010\u000e\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00100\u0016\"\u00020\u0010H\u0007¢\u0006\u0002\u0010\u0017R\u0018\u0010\u0003\u001a\u00020\u0004*\u00020\u00058BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0007¨\u0006\u0018"}, d2 = {"Lokio/Options$Companion;", "", "()V", "intCount", "", "Lokio/Buffer;", "getIntCount", "(Lokio/Buffer;)J", "buildTrieRecursive", "", "nodeOffset", "node", "byteStringOffset", "", "byteStrings", "", "Lokio/ByteString;", "fromIndex", "toIndex", "indexes", "of", "Lokio/Options;", "", "([Lokio/ByteString;)Lokio/Options;", "okio"} ) public static final class Companion { private Companion() { }
@JvmStatic @NotNull public final Options of(@NotNull ByteString... byteStrings) { Intrinsics.checkNotNullParameter(byteStrings, "byteStrings"); boolean var3 = false; if (byteStrings.length == 0) { ByteString[] var40 = new ByteString[0]; int[] var18 = new int[]{0, -1}; return new Options(var40, var18, (DefaultConstructorMarker)null); } else { List list = ArraysKt.toMutableList(byteStrings); CollectionsKt.sort(list); int $i$f$toTypedArray = false; Collection destination$iv$iv = (Collection)(new ArrayList(byteStrings.length)); int $i$f$mapTo = false; ByteString[] var10 = byteStrings; int var11 = byteStrings.length;
int callerIndex; for(callerIndex = 0; callerIndex < var11; ++callerIndex) { Object item$iv$iv = var10[callerIndex]; int var15 = false; Integer var17 = -1; destination$iv$iv.add(var17); }
Collection $this$toTypedArray$iv = (Collection)((List)destination$iv$iv); $i$f$toTypedArray = false; Object[] var10000 = $this$toTypedArray$iv.toArray(new Integer[0]); if (var10000 == null) { throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>"); } else { Integer[] var4 = (Integer[])var10000; List indexes = CollectionsKt.mutableListOf(Arrays.copyOf(var4, var4.length)); int $i$f$forEachIndexed = false; int b = 0; ByteString[] var7 = byteStrings; int var28 = byteStrings.length;
for(int var33 = 0; var33 < var28; ++var33) { Object item$iv = var7[var33]; callerIndex = b++; int var38 = false; int sortedIndex = CollectionsKt.binarySearch$default(list, (Comparable)item$iv, 0, 0, 6, (Object)null); indexes.set(sortedIndex, callerIndex); }
boolean var20 = ((ByteString)list.get(0)).size() > 0; $i$f$forEachIndexed = false; $i$f$toTypedArray = false; if (!var20) { int var29 = false; String var31 = "the empty byte string is not a supported option"; throw (Throwable)(new IllegalArgumentException(var31.toString())); } else { for(int a = 0; a < list.size(); ++a) { ByteString prefix = (ByteString)list.get(a); b = a + 1;
while(b < list.size()) { ByteString byteString = (ByteString)list.get(b); if (!byteString.startsWith(prefix)) { break; }
boolean var32 = byteString.size() != prefix.size(); $i$f$mapTo = false; boolean var35 = false; if (!var32) { int var37 = false; String var36 = Intrinsics.stringPlus("duplicate option: ", byteString); throw (Throwable)(new IllegalArgumentException(var36.toString())); }
if (((Number)indexes.get(b)).intValue() > ((Number)indexes.get(a)).intValue()) { list.remove(b); indexes.remove(b); } else { ++b; } } }
Buffer trieBytes = new Buffer(); buildTrieRecursive$default(this, 0L, trieBytes, 0, list, 0, 0, indexes, 53, (Object)null); int[] trie = new int[(int)this.getIntCount(trieBytes)];
for(int i = 0; !trieBytes.exhausted(); trie[var28] = trieBytes.readInt()) { var28 = i++; }
$i$f$mapTo = false; Object[] var10002 = Arrays.copyOf(byteStrings, byteStrings.length); Intrinsics.checkNotNullExpressionValue(var10002, "java.util.Arrays.copyOf(this, size)"); return new Options((ByteString[])var10002, trie, (DefaultConstructorMarker)null); } } } }
public Companion(DefaultConstructorMarker $constructor_marker) { this(); } } }
|