Skip to main content
kissgyorgy's user avatar
kissgyorgy's user avatar
kissgyorgy's user avatar
kissgyorgy
  • Member for 12 years, 11 months
  • Last seen more than 2 years ago
awarded
awarded
awarded
comment
Formatting big integers as hexadecimal digits separated by colons
Ok I just understood your version now. You use only one array, store the hex elements from the middle and store the final from the start reusing the full array at the end. I like it very much, thanks!
comment
comment
Formatting big integers as hexadecimal digits separated by colons
oh wow. I didn't wanted to use append to avoid multiple allocations, but the cap trick is nice! but how is yours so much faster than mine? what are those allocations in my version? I explicitly wanted to avoid those, that's whhy I made a byte slice and not string concatenation
revised
Formatting big integers as hexadecimal digits separated by colons
added examples with output and Go Playground link
Loading…
Loading…
accepted
awarded
revised
Requesting credentials from users
changed method names to clarify different implementation
Loading…
comment
Requesting credentials from users
Awesome review, thank you! Yes, check_config() is different. I didn't even thought of making config dict-like. I introduced a method config.set_param() and config.get_param() but it's not really better than setattr and getattr. Space typo :)
asked
Loading…
awarded
comment
Refactoring huge if..elif in __init__ how?
This is not DRY. Also it's better to define those functions as methods on the Range class instead for obvious reasons.
awarded
comment
Refactoring huge if..elif in __init__ how?
Wow, I did not even thought about separating the token definitions! I already separated the lexer, because at the first time I was doing parsing also, so even the parser logic was in the __init__ :) but this should clear things out even more! Thanks.
awarded
revised
Refactoring huge if..elif in __init__ how?
rolled back to a previous revision
Loading…