2 ms·
I suppose a side benefit of eliminating special cases is that you also eliminate branches, which may make things faster. If your preprocessing step is quick and
by roywiggins 8y ago
I suppose a side benefit of eliminating special cases is that you also eliminate branches, which may make things faster. If your preprocessing step is quick and branches are very expensive it might make a real difference.
It reminds me of programming assignments where you're tasked to solve a maze. Exploring the maze is really annoying if you have to special case the edges; much easier if you just build an edge-of-the-world wall first.