private FunctionCounter FindCounter(int funcIndex, int classScope, string name) { foreach (FunctionCounter c in core.funcCounterTable) { if (c.classScope == classScope && c.functionIndex == funcIndex) { // Comment it out. Looks this foreach loop is dead code. // - Yu Ke /* foreach (FunctionCounter c2 in core.funcCounterTable) { if (c.name.Equals(c2.name) && c2.name.ToCharArray()[0] != '%' && c2.name.ToCharArray()[0] != '_') { //c.sharedCounter++; if (c != c2) { // c2.sharedCounter++; } } } */ return c; } } FunctionCounter newC = new FunctionCounter(funcIndex, classScope, 0, name, 1); foreach (FunctionCounter c in core.funcCounterTable) { if (c.name.Equals(newC.name)) { //c.sharedCounter++; } } core.funcCounterTable.Add(newC); return newC; }
private FunctionCounter FindCounter(int funcIndex, int classScope, string name) { foreach (FunctionCounter c in exe.funcCounterTable) { if (c.classScope == classScope && c.functionIndex == funcIndex) { return c; } } FunctionCounter newC = new FunctionCounter(funcIndex, classScope, 0, name, 1); exe.funcCounterTable.Add(newC); return newC; }