kristjanmik/apis — pull request #30 by arnorhs (2013-05-03 07:52:39+00:00)
Title: Cleaned up the code in the /company endpoint.

- query string is now escaped properly
- removed the index variables (count, outerCount, etc)
- Fewer loops
- Simplified some of the DOM selectors
- made .html().replace regex a bit simpler by making a jquery plugin
- I'm hoping it might be more readable to newcomers this way.
- Also fixed an issue where when the address is blank, it was filled
with spaces, so now that gets trimmed.

Looking over the data and running the integration tests seems to reveal
that it's all still working

Btw. I hope I'm not stepping on any toes here.. I've been going through the endpoints and trying to clean up some stuff I saw could be simplified.. This is just the first one I finished.

If this is coding style that you guys think doesn't make sense, let me know.

The behavior doesn't change much, so you can feel free to deny the pull request.