Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Truffle] Don't calculate the entire byte[] when fetching a single byte.
The original approach works well when String#getbyte is called multiple times on the same string, since the rope pays the cost to calculate the array once and then can do quick access. However, this approach fell apart miserably when single byte access is performed over large ropes with sparse byte[]. As an example, pr-zlib does this frequently in its pure Ruby implementation of zlib.