MCPcopy Create free account
hub / github.com/Hiro420/NikkeTools / function_equal

Method function_equal

UnLuac/src/unluac/test/Compare.java:38–124  ·  view source on GitHub ↗
(LFunction f1, LFunction f2)

Source from the content-addressed store, hash-verified

36 }
37
38 public boolean function_equal(LFunction f1, LFunction f2) {
39 if(f1.maximumStackSize != f2.maximumStackSize) {
40 return false;
41 }
42 if(f1.numParams != f2.numParams) {
43 return false;
44 }
45 if(f1.numUpvalues != f2.numUpvalues) {
46 return false;
47 }
48 if(f1.vararg != f2.vararg) {
49 return false;
50 }
51 if(f1.code.length != f2.code.length) {
52 return false;
53 }
54 for(int i = 0; i < f1.code.length; i++) {
55 if(f1.code[i] != f2.code[i]) {
56 return false;
57 }
58 }
59 if(f1.constants.length != f2.constants.length) {
60 return false;
61 }
62 for(int i = 0; i < f1.constants.length; i++) {
63 if(!object_equal(f1.constants[i], f2.constants[i])) {
64 return false;
65 }
66 }
67 if(f1.locals.length != f2.locals.length) {
68 return false;
69 }
70 for(int i = 0; i < f1.locals.length; i++) {
71 if(!local_equal(f1.locals[i], f2.locals[i])) {
72 return false;
73 }
74 }
75 if(f1.upvalues.length != f2.upvalues.length) {
76 return false;
77 }
78 for(int i = 0; i < f1.upvalues.length; i++) {
79 if(!f1.upvalues[i].equals(f2.upvalues[i])) {
80 return false;
81 }
82 }
83 if(f1.functions.length != f2.functions.length) {
84 return false;
85 }
86 for(int i = 0; i < f1.functions.length; i++) {
87 if(!function_equal(f1.functions[i], f2.functions[i])) {
88 return false;
89 }
90 }
91 if(mode == Mode.FULL) {
92 if(!f1.name.equals(f2.name)) {
93 return false;
94 }
95 if(f1.linedefined != f2.linedefined) {

Callers 1

bytecode_equalMethod · 0.95

Calls 3

object_equalMethod · 0.95
local_equalMethod · 0.95
equalsMethod · 0.45

Tested by

no test coverage detected