MCPcopy Create free account
hub / github.com/antlr/codebuff / indexOfRandomAccess

Method indexOfRandomAccess

output/java_guava/1.4.18/Lists.java:1089–1105  ·  view source on GitHub ↗
(List<?> list, @Nullable Object element)

Source from the content-addressed store, hash-verified

1087 }
1088
1089 private static int indexOfRandomAccess(List<?> list, @Nullable Object element) {
1090 int size = list.size();
1091 if (element == null) {
1092 for (int i = 0; i < size; i++) {
1093 if (list.get(i) == null) {
1094 return i;
1095 }
1096 }
1097 } else {
1098 for (int i = 0; i < size; i++) {
1099 if (element.equals(list.get(i))) {
1100 return i;
1101 }
1102 }
1103 }
1104 return -1;
1105 }
1106
1107 /**
1108 * An implementation of {@link List#lastIndexOf(Object)}.

Callers 1

indexOfImplMethod · 0.95

Calls 3

sizeMethod · 0.65
getMethod · 0.65
equalsMethod · 0.65

Tested by

no test coverage detected