I've received several submissions just like this but have always avoided posting them because they seemed too short. Well, that, and I couldn't think of anything to say about this sort of (il)logic. I still got nothing, but fortunately Telek added a little more background:
I found this in source code that one of our customers sent us. They were complaining that when processing large incoming buffers our device ran too slow. I took a quick look through their code and it was no wonder why it was slow. However this one function, run on every character of the incoming/outgoing buffer, deserved special mention.
ushort GetAsciiValue (uchar ch) { ushort i; for (i=0; i<=255; i++) { if(ch == i) return i; } return 0; }
[Advertisement]
BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!