mozilla/rust — Issue #1612: RFC: Only track byte offsets in codemap and related modules
Author: kevina
Created: 2012-01-23 02:18:15+00:00
State: open

I do not believe it is really necessary to keep track of both the character and byte offset in codemap and related modules.

Spans and everything else should be using the byte offsets. The only place character offsets are likely needed is when reporting per line column offset, in that case it should be fairly easy to convert the byte offset from the start of the line to a character offset.

Removing all character offset tracking will likely simply the code somewhat.

Right now when trying to work with code in codemap I'm never quite sure if the offset is a byte or a character offset, furthermore at one point I had one offset in a byte offset and the other in a character offset (which is what prompted me to create this report).