Timeline for Optimal way of skipping certain values in a for loop
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 19, 2013 at 11:26 | vote | accept | Skarven | ||
Oct 10, 2013 at 14:18 | vote | accept | Skarven | ||
Oct 19, 2013 at 11:26 | |||||
Oct 10, 2013 at 3:10 | answer | added | technosaurus | timeline score: 3 | |
Oct 10, 2013 at 2:56 | answer | added | plalx | timeline score: 2 | |
Oct 10, 2013 at 2:31 | answer | added | 200_success | timeline score: 2 | |
Oct 9, 2013 at 20:21 | answer | added | Thomas Junk | timeline score: 2 | |
Oct 9, 2013 at 19:42 | comment | added | ChrisWue |
@Skarven: Make an array containing all the keys you want to skip and then if (keysToBeOmitted.Contains(key)) continue . If you are concerned about performance then make sure your keysToBeOmitted array is sorted and do a binary search on it (localCompare() should help with that)
|
|
Oct 9, 2013 at 19:02 | comment | added | Skarven | Sure, the keys in the object are fields in a SharePoint document library. There are a lot of default fields that I do not need, so I wish to skip the keys I do not need and add the rest to a fresh object. The function "arrayPushUknown" just adds the keys I need to the new object. | |
Oct 9, 2013 at 18:56 | comment | added | Malachi | could you elaborate a little more on what you are doing and what you want? what you are doing currently? | |
Oct 9, 2013 at 17:51 | comment | added | rlemon |
I'm a big fan of 'continue'. if( wanting_to_skip_condition ) continue; then the rest of the code you want run during a good loop.
|
|
Oct 9, 2013 at 17:42 | history | asked | Skarven | CC BY-SA 3.0 |