aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs
diff options
context:
space:
mode:
authorDr Scofield2008-06-30 11:57:47 +0000
committerDr Scofield2008-06-30 11:57:47 +0000
commit313f7f60fda81c987e0ac4da4dc8c2f5def46b72 (patch)
tree71c30ab49c97a17d157c59877842d159f5eac3e1 /OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs
parentdisables spam-like debugging messages inadvertently left on in last commit (o... (diff)
downloadopensim-SC-313f7f60fda81c987e0ac4da4dc8c2f5def46b72.zip
opensim-SC-313f7f60fda81c987e0ac4da4dc8c2f5def46b72.tar.gz
opensim-SC-313f7f60fda81c987e0ac4da4dc8c2f5def46b72.tar.bz2
opensim-SC-313f7f60fda81c987e0ac4da4dc8c2f5def46b72.tar.xz
properly explaining each #pragma warning disable
massaging OSHttpRequestPump to not abort on exceptions...
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs56
1 files changed, 28 insertions, 28 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs
index c52adb1..c2bb0b7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs
@@ -127,27 +127,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
127 // No unbound free variables, so we only filled one bag. If empty, bagof fails. 127 // No unbound free variables, so we only filled one bag. If empty, bagof fails.
128 if (_findallBagArray.Count > 0) 128 if (_findallBagArray.Count > 0)
129 { 129 {
130 // disable warning on l1, don't see how we can 130// disable warning: don't see how we can code this differently short
131 // code this differently 131// of rewriting the whole thing
132 #pragma warning disable 0168 132#pragma warning disable 0168
133 foreach (bool l1 in bagArrayVariable.unify(_findallBagArray)) 133 foreach (bool l1 in bagArrayVariable.unify(_findallBagArray))
134 yield return false; 134 yield return false;
135 #pragma warning restore 0168 135#pragma warning restore 0168
136 } 136 }
137 } 137 }
138 else 138 else
139 { 139 {
140 foreach (KeyValuePair<object[], List<object>> valuesAndBag in _bagForFreeVariables) 140 foreach (KeyValuePair<object[], List<object>> valuesAndBag in _bagForFreeVariables)
141 { 141 {
142 // disable warning on l1 and l2, don't see how we can 142// disable warning: don't see how we can code this differently short
143 // code this differently 143// of rewriting the whole thing
144 #pragma warning disable 0168 144#pragma warning disable 0168
145 foreach (bool l1 in YP.unifyArrays(_freeVariables, valuesAndBag.Key)) 145 foreach (bool l1 in YP.unifyArrays(_freeVariables, valuesAndBag.Key))
146 { 146 {
147 foreach (bool l2 in bagArrayVariable.unify(valuesAndBag.Value)) 147 foreach (bool l2 in bagArrayVariable.unify(valuesAndBag.Value))
148 yield return false; 148 yield return false;
149 } 149 }
150 #pragma warning restore 0168 150#pragma warning restore 0168
151 // Debug: Should we free memory of the answers already returned? 151 // Debug: Should we free memory of the answers already returned?
152 } 152 }
153 } 153 }
@@ -161,15 +161,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
161 public IEnumerable<bool> result(object Bag) 161 public IEnumerable<bool> result(object Bag)
162 { 162 {
163 Variable bagArrayVariable = new Variable(); 163 Variable bagArrayVariable = new Variable();
164 // disable warning on l1, don't see how we can 164// disable warning: don't see how we can code this differently short
165 // code this differently 165// of rewriting the whole thing
166 #pragma warning disable 0168 166#pragma warning disable 0168
167 foreach (bool l1 in resultArray(bagArrayVariable)) 167 foreach (bool l1 in resultArray(bagArrayVariable))
168 { 168 {
169 foreach (bool l2 in YP.unify(Bag, ListPair.make((List<object>)bagArrayVariable.getValue()))) 169 foreach (bool l2 in YP.unify(Bag, ListPair.make((List<object>)bagArrayVariable.getValue())))
170 yield return false; 170 yield return false;
171 } 171 }
172 #pragma warning restore 0168 172#pragma warning restore 0168
173 } 173 }
174 174
175 /// <summary> 175 /// <summary>
@@ -181,9 +181,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
181 public IEnumerable<bool> resultSet(object Bag) 181 public IEnumerable<bool> resultSet(object Bag)
182 { 182 {
183 Variable bagArrayVariable = new Variable(); 183 Variable bagArrayVariable = new Variable();
184 // disable warning on l1, don't see how we can 184// disable warning: don't see how we can code this differently short
185 // code this differently 185// of rewriting the whole thing
186 #pragma warning disable 0168 186#pragma warning disable 0168
187 foreach (bool l1 in resultArray(bagArrayVariable)) 187 foreach (bool l1 in resultArray(bagArrayVariable))
188 { 188 {
189 List<object> bagArray = (List<object>)bagArrayVariable.getValue(); 189 List<object> bagArray = (List<object>)bagArrayVariable.getValue();
@@ -191,19 +191,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
191 foreach (bool l2 in YP.unify(Bag, ListPair.makeWithoutRepeatedTerms(bagArray))) 191 foreach (bool l2 in YP.unify(Bag, ListPair.makeWithoutRepeatedTerms(bagArray)))
192 yield return false; 192 yield return false;
193 } 193 }
194 #pragma warning restore 0168 194#pragma warning restore 0168
195 } 195 }
196 196
197 public static IEnumerable<bool> bagofArray 197 public static IEnumerable<bool> bagofArray
198 (object Template, object Goal, IEnumerable<bool> goalIterator, Variable bagArrayVariable) 198 (object Template, object Goal, IEnumerable<bool> goalIterator, Variable bagArrayVariable)
199 { 199 {
200 BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal); 200 BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal);
201 // disable warning on l1, don't see how we can 201// disable warning: don't see how we can code this differently short
202 // code this differently 202// of rewriting the whole thing
203 #pragma warning disable 0168 203#pragma warning disable 0168
204 foreach (bool l1 in goalIterator) 204 foreach (bool l1 in goalIterator)
205 bagOfAnswers.add(); 205 bagOfAnswers.add();
206 #pragma warning restore 0168 206#pragma warning restore 0168
207 return bagOfAnswers.resultArray(bagArrayVariable); 207 return bagOfAnswers.resultArray(bagArrayVariable);
208 } 208 }
209 209
@@ -211,12 +211,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
211 (object Template, object Goal, IEnumerable<bool> goalIterator, object Bag) 211 (object Template, object Goal, IEnumerable<bool> goalIterator, object Bag)
212 { 212 {
213 BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal); 213 BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal);
214 // disable warning on l1, don't see how we can 214// disable warning: don't see how we can code this differently short
215 // code this differently 215// of rewriting the whole thing
216 #pragma warning disable 0168 216#pragma warning disable 0168
217 foreach (bool l1 in goalIterator) 217 foreach (bool l1 in goalIterator)
218 bagOfAnswers.add(); 218 bagOfAnswers.add();
219 #pragma warning restore 0168 219#pragma warning restore 0168
220 return bagOfAnswers.result(Bag); 220 return bagOfAnswers.result(Bag);
221 } 221 }
222 222
@@ -224,12 +224,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
224 (object Template, object Goal, IEnumerable<bool> goalIterator, object Bag) 224 (object Template, object Goal, IEnumerable<bool> goalIterator, object Bag)
225 { 225 {
226 BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal); 226 BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal);
227 // disable warning on l1, don't see how we can 227// disable warning: don't see how we can code this differently short
228 // code this differently 228// of rewriting the whole thing
229 #pragma warning disable 0168 229#pragma warning disable 0168
230 foreach (bool l1 in goalIterator) 230 foreach (bool l1 in goalIterator)
231 bagOfAnswers.add(); 231 bagOfAnswers.add();
232 #pragma warning restore 0168 232#pragma warning restore 0168
233 return bagOfAnswers.resultSet(Bag); 233 return bagOfAnswers.resultSet(Bag);
234 } 234 }
235 235