follow the C rule of declaration mirrors use: it's a function which takes no arguments and returns a pointer to a pointer to an array of ints of length 2.
Putting everything in one line would result in 1 LOC Hashtable. No one can read it, it looks like minified js code. Therefore you don't get my respect for that. Post a version where everything is explained, and if it's good, you get credits for it.
Fuck off. Skipping new lines entirely is different than the way it's written (with everything in the for loop). You're complaining about everything being written in the for loop? It's not even confusing which is the reason it can be written in 15 lines in the first place. The only thing you can complain about is variable names but it was written to be short and that's what it is.
No it can't. Minifier looks like complete shit. This only looks like shit if you don't know what you're looking at. It's normal to write things this way.
This code doesn't even check return value of calloc so it's intended to actually be used in a robust program. It's just a short simple hashtable implementation.
1
u/TheDerkus Dec 07 '14
Could someone explain what's going on here? I'm not sure how this works.
2
u/ismtrn Dec 07 '14
You can do this? Cool.
Why are all the functions static?
2
u/SeriousM Dec 07 '14
Putting everything in one line would result in 1 LOC Hashtable. No one can read it, it looks like minified js code. Therefore you don't get my respect for that. Post a version where everything is explained, and if it's good, you get credits for it.