MCPcopy Create free account
hub / github.com/FabricMC/Matcher / findVarIndexByLv

Method findVarIndexByLv

src/main/java/matcher/mapping/Mappings.java:441–453  ·  view source on GitHub ↗
(MethodVarInstance[] vars, int lvIndex, int startOpcodeIdx)

Source from the content-addressed store, hash-verified

439 }
440
441 private static int findVarIndexByLv(MethodVarInstance[] vars, int lvIndex, int startOpcodeIdx) {
442 MethodVarInstance ret = null;
443
444 for (MethodVarInstance arg : vars) {
445 if (arg.getLvIndex() == lvIndex
446 && arg.getStartOpIdx() >= startOpcodeIdx // assumes matcher's startInsn is not early, also works with startInsn == -1
447 && (ret == null || arg.getStartOpIdx() < ret.getStartOpIdx())) {
448 ret = arg;
449 }
450 }
451
452 return ret != null ? ret.getIndex() : -1;
453 }
454
455 private static int findVarIndexByAsm(MethodVarInstance[] vars, int asmIndex) {
456 for (MethodVarInstance arg : vars) {

Callers 1

getMethodVarMethod · 0.95

Calls 3

getStartOpIdxMethod · 0.95
getIndexMethod · 0.95
getLvIndexMethod · 0.80

Tested by

no test coverage detected