posted 12 years ago
I'm not sure what you mean by "quicker". The only way I can think of to possibly do it would be something like
but personally, I find this code to be VERY ugly, and would tell anyone under me to write it the way you did originally.
note: I fixed your post - you had the code tags, but your code was not between them, it was after both.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors