-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Comparing changes
Open a pull request
base repository: crystal-lang/crystal
base: 566bd7452009
head repository: crystal-lang/crystal
compare: bda40f805ace
- 18 commits
- 60 files changed
- 1 contributor
Commits on Jan 29, 2017
-
Compiler: fixed incorrect associativity of
foo bar.baz(x) do ... end
Ary Borenszweig committedJan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for 2edd4d3 - Browse repository at this point
Copy the full SHA 2edd4d3View commit details -
Char::Reader: add backwards traversal
Ary Borenszweig committedJan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for 0e44106 - Browse repository at this point
Copy the full SHA 0e44106View commit details -
Ary Borenszweig committed
Jan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for ae8afca - Browse repository at this point
Copy the full SHA ae8afcaView commit details -
IO#skip: fixed skipping more than buffer size
Ary Borenszweig committedJan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for 71de860 - Browse repository at this point
Copy the full SHA 71de860View commit details -
IO: added specs for gets with encoding, char and chomp
Ary Borenszweig committedJan 29, 2017 1Configuration menu - View commit details
-
Copy full SHA for 2e17f54 - Browse repository at this point
Copy the full SHA 2e17f54View commit details -
IO: let
read_string
be encoding-awareAry Borenszweig committedJan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for 9ed093f - Browse repository at this point
Copy the full SHA 9ed093fView commit details -
IO::Memory: override skip and skip_to_end
Ary Borenszweig committedJan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for 9a3e252 - Browse repository at this point
Copy the full SHA 9a3e252View commit details -
Ary Borenszweig committed
Jan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for eb5062e - Browse repository at this point
Copy the full SHA eb5062eView commit details -
String#at: optimization: use char_index_to_byte_index
Ary Borenszweig committedJan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for a2f211e - Browse repository at this point
Copy the full SHA a2f211eView commit details -
Zip::CompressionMethod: place it in the correct directory
Ary Borenszweig committedJan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for 5e7adab - Browse repository at this point
Copy the full SHA 5e7adabView commit details -
Ary Borenszweig committed
Jan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for eb3236d - Browse repository at this point
Copy the full SHA eb3236dView commit details -
String#rindex: use Char::Reader backwards traversal
Ary Borenszweig committedJan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for 4d31553 - Browse repository at this point
Copy the full SHA 4d31553View commit details -
Spec: make assert give a deprecation error, and tell how to upgrade e…
…xisting code. Related to #3922
Ary Borenszweig committedJan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for a31514c - Browse repository at this point
Copy the full SHA a31514cView commit details -
String: added
strip
,rstrip
andlstrip
overloads that accept a ……Char, String or a block
Ary Borenszweig committedJan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for 991740d - Browse repository at this point
Copy the full SHA 991740dView commit details -
HTTP: add
skip
overloads for HTTP::Content classesAry Borenszweig committedJan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for da09dac - Browse repository at this point
Copy the full SHA da09dacView commit details -
IO::Sized: override
skip
methodAry Borenszweig committedJan 29, 2017 Configuration menu - View commit details
-
Copy full SHA for 94820c6 - Browse repository at this point
Copy the full SHA 94820c6View commit details -
This method lets you peek into possibly buffered data held by an IO. With this, some methods, for example `gets`, can be performed more efficiently: if we can see which bytes come next we can see if there's the delimiter we are looking for. Before this, this optimization for `gets` was implemented in `IO::Buffered`, which has direct access to this buffer, with some other IO wrappers forwarding their `gets` method to the wrapped IOs. By introducing `peek`, `gets` can now be implemented directly in `IO`, by trying to peek into the buffer, if any. Since IOs in Crystal are buffered in most cases (IO::FileDescriptor is, and IO::Memory can return the whole bytes are in `peek`) it's almost always the case that `gets` will benefit from this optimization. Additionally, `IO::Sized`, which previously overrode `gets`, no longer needs to do it and can now just override `peek`, which has a much simpler implementation. In this particular case it also leads to a faster `gets` performance. This `peek` method can also be defined for other IOs, like ARGF and HTTP::Content, simplifying their code. Another future optimization is to enhance `IO::Delimtied` by trying to peek into an IO's buffer to see if the delimiter is there, instead of working with a byte buffer that has the size of the delimiter. Finally, the current Zlib::Inflate implementation reads more data than it should, which is incorrect and can lead to, for example, some zip files to be incorrectly parsed. A correct solution to this is to either reimplement the DEFLATE algorithm in Crystal, or to feed zlib data byte per byte. The later is simpler, but slower. But with `peek` we can feed more data, know how much was actually used, and only `skip` that much data without effectively reading more than necessary.
Ary Borenszweig committedJan 29, 2017 1Configuration menu - View commit details
-
Copy full SHA for df10240 - Browse repository at this point
Copy the full SHA df10240View commit details -
Zlib: split into Adler32, CRC32, Flate, Gzip and Zlib types
Crystal provides access to the Adler32, CRC32, DEFLATE, gzip and zlib algorithms/formats. It currently does so by binding to zlib (also known as libz). However, zlib is just an implementation detail: this shouldn't leak to type and method names because if we eventually decide to change the library used to implement these, or maybe implement stuff in pure Crystal, we'll be stuck with this name. So, here we split the contents of the Zlib module into: - Adler32, for the Adler32 checksum algorithm - CRC32, for the CRC32 checksum algorithm - Flate: for the DEFLATE compression format (RFC 1951), providing Reader and Writer types (Inflate and Deflate could also work, but Reader and Writer are more obvious and consistent.) Flate is also the name used by Go to provide the same functionality, so it will be familiar to some. - Gzip: for the gzip archive format (RFC 1952), which is just a small wrapper (header and checksum) around the DEFLATE format. Reader and Writer are provided, together with access to the first gzip header. - Zlib: for the zlib archive format (RFC 1950), which is just a small wrapper around the DEFLATE format too (here the format is also named the same as the C library, which brings a lot of confusion). Reader and Writer are provided. By doing this we also remove the need to know how to use the zlib C library, which requires users to provide a cryptic `windowBits` argument to choose the desierd format. Finally, we rename HTTP::DeflateHandler to HTTP::CompressHandler because that's what it does: it compress responses in either gzip or DEFLATE, but not always DEFLATE (so the name was misleading). All of this is a big breaking change, but should be easy to upgrade existing code and makes the standard library more consistent and organized.
Ary Borenszweig committedJan 29, 2017 1Configuration menu - View commit details
-
Copy full SHA for bda40f8 - Browse repository at this point
Copy the full SHA bda40f8View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 566bd7452009...bda40f805ace