ring-clojure / ring-codec

Utility library for encoding and decoding data
MIT License
63 stars 30 forks source link

Replace default charset string type to Charset #41

Closed bsless closed 1 year ago

bsless commented 1 year ago

By providing the default encoding as Charset and not String we can avoid repeated lookups in hot paths.

Closes #40

bsless commented 1 year ago

@weavejester Done proposed changes, added one implicit test of to-charset's behavior by providing different types of arguments in test-url-encode. I didn't change the behavior of percent-decode. It already accepted encoding, but I pulled it out of the closure to avoid repeated lookups for each match.

weavejester commented 1 year ago

Thanks for the update. I merged another PR that I didn't expect to conflict with this one, but it did so I'm afraid that you'll have to rebase off master. Sorry about that!

Could you also change the commit message to:

Replace charset String type with Charset type

By providing the default encoding as Charset, repeated lookups can be
avoided in hot paths.

Fixes #40.
bsless commented 1 year ago

Done :tada: