-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple PRs #2662
Multiple PRs #2662
Conversation
6a78aba
to
61d72d2
Compare
b8b6bfa
to
1875e5d
Compare
371720b
to
89bcc28
Compare
d15e389
to
1f6ac70
Compare
ae6a9e1
to
abdb716
Compare
in Skip (MECSBuffer remElem st1) | ||
Yield arr st1 -> | ||
let len = Array.length arr | ||
in if (len .&. 1) == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use odd
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
odd
uses div
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm..that's odd.
in Yield w16 | ||
(MECSYieldAndBuffer arr1 lstElem st1) | ||
Skip s -> Skip (MECSBuffer remElem s) | ||
Stop -> Stop -- Here the last Word8 is lost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of strict decoding, this should be an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has nothing to do with utf16 decoding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only used in the benchmark for now anyway, so I don't want to spend more time on this. We can change this if this use-case ever arises.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it has nothing to do with it then we should not use it in decoding :-) Because decoding should fail if it finds the input is truncated. If this drops silently, decoder won't even know that some part of the input was dropped, it will just happily use whatever it got.
f5e9741
to
1e7224a
Compare
, decodeUtf16' | ||
, decodeUtf16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can keep these unexposed. Don't know if we'll ever use this without taking byte-order into consideration.
- Add identity tests - Add benchmarks - Add Word16 to Word8 helpers
1e7224a
to
d8d7b29
Compare
copyStreamUtf16 :: Handle -> Handle -> IO () | ||
copyStreamUtf16 inh outh = | ||
Stream.fold (Handle.writeChunks outh) | ||
$ fmap Array.castUnsafe $ Array.chunksOf (arrayPayloadSize (16 * 1024)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use defaultChunkSize instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping the number of elements constant for comparison.
No description provided.