fn lookup_filemap_idx(&self, pos: BytePos) -> usize {
        let files = self.files.borrow();
        let files = &*files;
        let count = files.len();

        // Binary search for the filemap.
        let mut a = 0;
        let mut b = count;
        while b - a > 1 {
            let m = (a + b) / 2;
            if files[m].start_pos > pos {
                b = m;
            } else {
                a = m;
            }
        }

        assert!(a < count, "position {} does not resolve to a source location", pos.to_usize());

        return a;
    }
// Return the index of the filemap (in self.files) which contains pos.
Return the index of the filemap (in self.files) which contains pos.
Return the index of the filemap ( in self . files ) which contains pos .
fn lookup_filemap_idx(&self, pos: BytePos) -> usize {
        let files = self.files.borrow();
        let files = &*files;
        let count = files.len();
        // Binary search for the filemap.
        let mut a = 0;
        let mut b = count;
        while b - a > 1 {
            let m = (a + b) / 2;
            if files[m].start_pos > pos {
                b = m;
            } else {
                a = m;
            }
        }
        assert!(a < count, "position {} does not resolve to a source location", pos.to_usize());
        return a;
    }
fn lookup_filemap_idx ( & self , pos : BytePos ) -> usize { let files = self . files . borrow ( ) ; let files = & * files ; let count = files . len ( ) ; // Binary search for the filemap. let mut a = 0 ; let mut b = count ; while b - a > 1 { let m = ( a + b ) / 2 ; if files [ m ] . start_pos > pos { b = m ; } else { a = m ; } } assert ! ( a count " " pos to_usize ( ) ) ; return a ; }
Return the index of the filemap (in self.files) which contains pos.
Return the index of the filemap ( in self . files ) which contains pos .
&self
pos
BytePos
&self
pos
BytePos