Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WB Script
#7
Maybe better getInstance like this:
Squirrel Script
  1. function getInstance(id)
  2. {
  3. if (id >= 0 && id < List.len())
  4. return List[id]
  5.  
  6. return null;
  7. };



Edit. Performance of this code is O(1), but your code is O(n).
Reply


Messages In This Thread
WB Script - by Quarchodron - 19.10.2015, 14:28
RE: WB Script - by Kladvey - 06.01.2016, 23:56
RE: WB Script - by AJJ - 07.01.2016, 00:42
RE: WB Script - by Razir - 07.01.2016, 19:52
RE: WB Script - by Profesores - 07.01.2016, 19:55
RE: WB Script - by Quarchodron - 15.02.2016, 00:59
RE: WB Script - by Bimbol - 15.02.2016, 18:03
RE: WB Script - by Quarchodron - 15.02.2016, 22:06
RE: WB Script - by Bimbol - 15.02.2016, 22:14

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PL] Simple TDM Script Quarchodron 1 4,192 10.10.2015, 16:26
Last Post: Jayson

Forum Jump:


Users browsing this thread: 1 Guest(s)