class Prism::CodeUnitsCache::LengthCounter

:nodoc:

def count(byte_offset, byte_length)

def count(byte_offset, byte_length)
  @source.byteslice(byte_offset, byte_length).encode(@encoding, invalid: :replace, undef: :replace).length
end

def initialize(source, encoding)

:nodoc:
def initialize(source, encoding)
  @source = source
  @encoding = encoding
end