Advertisement
ijontichy

<stdin>

Feb 27th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. function int unusedTID(int start, int end)
  2. {
  3. int ret = start - 1;
  4. int tidNum;
  5.  
  6. if (start > end) { start ^= end; end ^= start; start ^= end; } // good ol' XOR swap
  7.  
  8. while (ret++ != end)
  9. {
  10. if (ThingCount(0, ret) == 0)
  11. {
  12. return ret;
  13. }
  14. }
  15.  
  16. return -1;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement