[System.Security.SecurityCritical] // auto-generated public StringExpressionSet Union(StringExpressionSet ses) { // If either set is empty, the union represents a copy of the other. if (ses == null || ses.IsEmpty()) { return(this.Copy()); } if (this.IsEmpty()) { return(ses.Copy()); } CheckList(); ses.CheckList(); // Perform the union // note: insert smaller set into bigger set to reduce needed comparisons StringExpressionSet bigger = ses.m_list.Count > this.m_list.Count ? ses : this; StringExpressionSet smaller = ses.m_list.Count <= this.m_list.Count ? ses : this; StringExpressionSet unionSet = bigger.Copy(); unionSet.Reduce(); for (int index = 0; index < smaller.m_list.Count; ++index) { unionSet.AddSingleExpressionNoDuplicates((String)smaller.m_list[index]); } unionSet.GenerateString(); return(unionSet); }
public StringExpressionSet Union(StringExpressionSet ses) { if (ses == null || ses.IsEmpty()) { return(this.Copy()); } if (this.IsEmpty()) { return(ses.Copy()); } this.CheckList(); ses.CheckList(); StringExpressionSet stringExpressionSet = (ses.m_list.Count > this.m_list.Count) ? ses : this; StringExpressionSet stringExpressionSet2 = (ses.m_list.Count <= this.m_list.Count) ? ses : this; StringExpressionSet stringExpressionSet3 = stringExpressionSet.Copy(); stringExpressionSet3.Reduce(); for (int i = 0; i < stringExpressionSet2.m_list.Count; i++) { stringExpressionSet3.AddSingleExpressionNoDuplicates((string)stringExpressionSet2.m_list[i]); } stringExpressionSet3.GenerateString(); return(stringExpressionSet3); }
[System.Security.SecurityCritical] // auto-generated public StringExpressionSet Union( StringExpressionSet ses ) { // If either set is empty, the union represents a copy of the other. if (ses == null || ses.IsEmpty()) return this.Copy(); if (this.IsEmpty()) return ses.Copy(); CheckList(); ses.CheckList(); // Perform the union // note: insert smaller set into bigger set to reduce needed comparisons StringExpressionSet bigger = ses.m_list.Count > this.m_list.Count ? ses : this; StringExpressionSet smaller = ses.m_list.Count <= this.m_list.Count ? ses : this; StringExpressionSet unionSet = bigger.Copy(); unionSet.Reduce(); for (int index = 0; index < smaller.m_list.Count; ++index) { unionSet.AddSingleExpressionNoDuplicates( (String)smaller.m_list[index] ); } unionSet.GenerateString(); return unionSet; }
public StringExpressionSet Union(StringExpressionSet ses) { if ((ses == null) || ses.IsEmpty()) { return this.Copy(); } if (this.IsEmpty()) { return ses.Copy(); } this.CheckList(); ses.CheckList(); StringExpressionSet set = (ses.m_list.Count > this.m_list.Count) ? ses : this; StringExpressionSet set2 = (ses.m_list.Count <= this.m_list.Count) ? ses : this; StringExpressionSet set3 = set.Copy(); set3.Reduce(); for (int i = 0; i < set2.m_list.Count; i++) { set3.AddSingleExpressionNoDuplicates((string) set2.m_list[i]); } set3.GenerateString(); return set3; }