diff options
| author | Youngmin Yoo <youngmin.yoo@samsung.com> | 2013-05-14 18:52:12 +0900 |
|---|---|---|
| committer | Youngmin Yoo <youngmin.yoo@samsung.com> | 2013-05-15 11:05:28 +0900 |
| commit | a2a8596c3dd963e7b51f11998cffc46033bf6d63 (patch) | |
| tree | 2ea272be21c9a7b7d486be08fe0a3dcb10c8a132 /src/libstd/sync.rs | |
| parent | c30414f980eb3e8010640f6c83a5ef6f8e6ab047 (diff) | |
| download | rust-a2a8596c3dd963e7b51f11998cffc46033bf6d63.tar.gz rust-a2a8596c3dd963e7b51f11998cffc46033bf6d63.zip | |
Rename vec::len(var) to var.len()
Diffstat (limited to 'src/libstd/sync.rs')
| -rw-r--r-- | src/libstd/sync.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index 59c6a804408..449edacad32 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -19,7 +19,6 @@ use core::unstable::sync::{Exclusive, exclusive}; use core::ptr; use core::task; use core::util; -use core::vec; /**************************************************************************** * Internals @@ -220,7 +219,7 @@ pub impl<'self> Condvar<'self> { do task::unkillable { // Release lock, 'atomically' enqueuing ourselves in so doing. do (**self.sem).with |state| { - if condvar_id < vec::len(state.blocked) { + if condvar_id < state.blocked.len() { // Drop the lock. state.count += 1; if state.count <= 0 { @@ -230,7 +229,7 @@ pub impl<'self> Condvar<'self> { let SignalEnd = SignalEnd.swap_unwrap(); state.blocked[condvar_id].tail.send(SignalEnd); } else { - out_of_bounds = Some(vec::len(state.blocked)); + out_of_bounds = Some(state.blocked.len()); } } @@ -285,10 +284,10 @@ pub impl<'self> Condvar<'self> { let mut out_of_bounds = None; let mut result = false; do (**self.sem).with |state| { - if condvar_id < vec::len(state.blocked) { + if condvar_id < state.blocked.len() { result = signal_waitqueue(&state.blocked[condvar_id]); } else { - out_of_bounds = Some(vec::len(state.blocked)); + out_of_bounds = Some(state.blocked.len()); } } do check_cvar_bounds(out_of_bounds, condvar_id, "cond.signal_on()") { @@ -304,14 +303,14 @@ pub impl<'self> Condvar<'self> { let mut out_of_bounds = None; let mut queue = None; do (**self.sem).with |state| { - if condvar_id < vec::len(state.blocked) { + if condvar_id < state.blocked.len() { // To avoid :broadcast_heavy, we make a new waitqueue, // swap it out with the old one, and broadcast on the // old one outside of the little-lock. queue = Some(util::replace(&mut state.blocked[condvar_id], new_waitqueue())); } else { - out_of_bounds = Some(vec::len(state.blocked)); + out_of_bounds = Some(state.blocked.len()); } } do check_cvar_bounds(out_of_bounds, condvar_id, "cond.signal_on()") { |
