4 ms·
The lesson here is use library functions. Someone smarter than you has probably optimized the hell out of them.
by lacker 18y ago
The lesson here is use library functions. Someone smarter than you has probably optimized the hell out of them.
- albemuth 18y agoThe glibc guys did not heed such advice :P
- sep332 18y agooh snap!
- tlrobinson 18y agoIndeed, in college I was interviewing for a job, and the interviewer asked how I would determine the length of a null terminated string, and I thought I nailed it by giving a typical "while(*(str++)) c++;" implementation. The "right" answer was just to use strlen()...
- nostrademons 18y agoI had a job interview once where the question was "find all descendants of a DOM node with a certain tag name, and return them in document order." I thought for about 30 seconds, and then wrote up on the board: element.getElementsByTagName(tagName); That was what he was looking for. ;-) Of course, then he had me do it out as if getElementsByTagName didn't exist.