librustc: Extract `first_move` from the move data into an accessor

This commit is contained in:
Patrick Walton 2013-12-21 18:32:54 -08:00
parent f19a9b9600
commit f700cf3872
1 changed files with 6 additions and 2 deletions

View File

@ -181,6 +181,10 @@ impl MoveData {
self.paths[*index].parent
}
fn path_first_move(&self, index: MovePathIndex) -> MoveIndex {
self.paths[*index].first_move
}
fn path<'a>(&'a self, index: MovePathIndex) -> &'a MovePath {
//! Type safe indexing operator
&self.paths[*index]
@ -319,7 +323,7 @@ impl MoveData {
let path_index = self.move_path(tcx, lp);
let move_index = MoveIndex(self.moves.len());
let next_move = self.path(path_index).first_move;
let next_move = self.path_first_move(path_index);
self.mut_path(path_index).first_move = move_index;
self.moves.push(Move {
@ -456,7 +460,7 @@ impl MoveData {
-> bool {
let mut ret = true;
self.each_extending_path(index0, |index| {
let mut p = self.path(index).first_move;
let mut p = self.path_first_move(index);
while p != InvalidMoveIndex {
if !f(p) {
ret = false;