public bool contains_1_2(int arg12) { PrepareInsert12(); if (Array.SortedArrayContains(insertList12, arg12)) { return(true); } if (table.contains_1_2(arg12)) { //## THIS COULD BE MADE FASTER BY CHECKING FIRST WHETHER arg12 APPEARS IN THE DELETE LIST AT ALL Prepare(); Sym12TernaryTable.Iter it = table.getIter_1_2(arg12); Debug.Assert(!it.Done()); do { int arg1 = arg12; int arg2 = it.Get1(); int arg3 = it.Get2(); if (arg1 >= arg2) { arg1 = arg2; arg2 = arg12; } if (!Ints123.Contains(deleteList, deleteCount, arg1, arg2, arg3)) { return(true); } it.Next(); } while (!it.Done()); } return(false); }
////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// public static void Write(DataWriter writer, int fieldSymbId, Sym12TernaryTable[] tables, int indentation, bool indentFirstLine, bool writeSeparator) { string baseWs = new string(Array.Repeat(' ', indentation)); string entryWs = new string(Array.Repeat(' ', indentation + 2)); int count = 0; for (int i = 0; i < tables.Length; i++) { count += tables[i].Size(); } if (indentFirstLine) { writer.Write(baseWs); } writer.Write(SymbObj.IdxToStr(fieldSymbId)); writer.Write(": ["); if (count > 0) { writer.Write("\n"); int written = 0; for (int i = 0; i < tables.Length; i++) { Sym12TernaryTable table = tables[i]; SurrObjMapper mapper12 = table.mapper12; SurrObjMapper mapper3 = table.mapper3; Sym12TernaryTable.Iter it = table.GetIter(); while (!it.Done()) { writer.Write(entryWs); Obj obj1 = mapper12(it.Get1()); Obj obj2 = mapper12(it.Get2()); Obj obj3 = mapper3(it.Get3()); ObjPrinter.PrintNoFlush(obj1, writer); writer.Write(", "); ObjPrinter.PrintNoFlush(obj2, writer); writer.Write(", "); ObjPrinter.PrintNoFlush(obj3, writer); written++; writer.Write(written < count || count == 1 ? ";\n" : "\n"); it.Next(); } } Debug.Assert(written == count); writer.Write(baseWs); } writer.Write(writeSeparator ? "],\n" : "]\n"); }
public void Delete_13_23(int arg12, int arg3) { Sym12TernaryTable.Iter it = table.getIter_13_23(arg12, arg3); while (!it.Done()) { int arg1 = arg12; int arg2 = it.Get1(); if (arg1 > arg2) { arg1 = arg2; arg2 = arg12; } deleteList = Array.Append3(deleteList, deleteCount++, arg1, arg2, arg3); it.Next(); } }