Skip to content

Commit

Permalink
Changes based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
murphm8 authored and Ms2ger committed May 4, 2014
1 parent af920f4 commit 8b94a44
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/components/gfx/buffer_map.rs
Expand Up @@ -54,7 +54,7 @@ impl BufferKey {
/// A helper struct to keep track of buffers in the HashMap
struct BufferValue<T> {
/// An array of buffers, all the same size
buffers: Vec<T>,
buffers: Vec<T>,
/// The counter when this size was last requested
last_action: uint,
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/gfx/render_task.rs
Expand Up @@ -256,7 +256,7 @@ impl<C: RenderListener + Send> RenderTask<C> {
}
}
UnusedBufferMsg(unused_buffers) => {
for buffer in unused_buffers.move_iter() {
for buffer in unused_buffers.move_iter().rev() {
self.buffer_map.insert(native_graphics_context!(self), buffer);
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/components/gfx/text/glyph.rs
Expand Up @@ -555,20 +555,20 @@ impl<'a> GlyphStore {
self.entry_buffer[i] = entry;
}

pub fn add_glyphs_for_char_index(&mut self, i: uint, data_for_glyphs: &Vec<GlyphData>) {
pub fn add_glyphs_for_char_index(&mut self, i: uint, data_for_glyphs: &[GlyphData]) {
assert!(i < self.entry_buffer.len());
assert!(data_for_glyphs.len() > 0);

let glyph_count = data_for_glyphs.len();

let first_glyph_data = data_for_glyphs.get(0);
let first_glyph_data = data_for_glyphs[0];
let entry = match first_glyph_data.is_missing {
true => GlyphEntry::missing(glyph_count),
false => {
let glyphs_vec = slice::from_fn(glyph_count, |i| {
DetailedGlyph::new(data_for_glyphs.get(i).index,
data_for_glyphs.get(i).advance,
data_for_glyphs.get(i).offset)
DetailedGlyph::new(data_for_glyphs[i].index,
data_for_glyphs[i].advance,
data_for_glyphs[i].offset)
});

self.detail_store.add_detailed_glyphs_for_entry(i, glyphs_vec);
Expand Down
2 changes: 1 addition & 1 deletion src/components/gfx/text/shaping/harfbuzz.rs
Expand Up @@ -425,7 +425,7 @@ impl Shaper {
}

// now add the detailed glyph entry.
glyphs.add_glyphs_for_char_index(char_idx, &datas);
glyphs.add_glyphs_for_char_index(char_idx, datas.as_slice());

// set the other chars, who have no glyphs
let mut i = covered_byte_span.begin();
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/compositing/compositor_layer.rs
Expand Up @@ -842,7 +842,7 @@ impl CompositorLayer {
};

let mut unused_tiles = vec!();
for buffer in new_buffers.buffers.move_iter() {
for buffer in new_buffers.buffers.move_iter().rev() {
unused_tiles.push_all_move(quadtree.add_tile_pixel(buffer.screen_pos.origin.x,
buffer.screen_pos.origin.y,
buffer.resolution,
Expand Down
2 changes: 1 addition & 1 deletion src/components/script/script_task.rs
Expand Up @@ -1133,7 +1133,7 @@ impl ScriptTask {
match page.get_nodes_under_mouse(&point) {
Some(node_address) => {

let mut target_list: Vec<JS<Node>> = vec!();
let mut target_list = vec!();
let mut target_compare = false;

let mouse_over_targets = &mut *self.mouse_over_targets.borrow_mut();
Expand Down
10 changes: 5 additions & 5 deletions src/components/style/selectors.rs
Expand Up @@ -197,18 +197,18 @@ fn compute_specificity(mut selector: &CompoundSelector,
};
if pseudo_element.is_some() { specificity.element_selectors += 1 }

simple_selectors_specificity(&selector.simple_selectors, &mut specificity);
simple_selectors_specificity(selector.simple_selectors.as_slice(), &mut specificity);
loop {
match selector.next {
None => break,
Some((ref next_selector, _)) => {
selector = &**next_selector;
simple_selectors_specificity(&selector.simple_selectors, &mut specificity)
simple_selectors_specificity(selector.simple_selectors.as_slice(), &mut specificity)
}
}
}

fn simple_selectors_specificity(simple_selectors: &Vec<SimpleSelector>,
fn simple_selectors_specificity(simple_selectors: &[SimpleSelector],
specificity: &mut Specificity) {
for simple_selector in simple_selectors.iter() {
match simple_selector {
Expand All @@ -226,7 +226,7 @@ fn compute_specificity(mut selector: &CompoundSelector,
=> specificity.class_like_selectors += 1,
&NamespaceSelector(..) => (),
&Negation(ref negated)
=> simple_selectors_specificity(negated, specificity),
=> simple_selectors_specificity(negated.as_slice(), specificity),
}
}
}
Expand Down Expand Up @@ -680,7 +680,7 @@ mod tests {
// Default namespace does apply to type selectors
assert!(parse_ns("e", &namespaces) == Some(vec!(Selector{
compound_selectors: Arc::new(CompoundSelector {
simple_selectors: vec!(
simple_selectors: vec!(
NamespaceSelector(namespace::MathML),
LocalNameSelector("e".to_owned()),
),
Expand Down
2 changes: 1 addition & 1 deletion src/components/style/stylesheets.rs
Expand Up @@ -44,7 +44,7 @@ impl Stylesheet {
pub fn from_bytes_iter<I: Iterator<Vec<u8>>>(
mut input: I, base_url: Url, protocol_encoding_label: Option<&str>,
environment_encoding: Option<EncodingRef>) -> Stylesheet {
let mut bytes = vec!();
let mut bytes = vec!();
// TODO: incremental decoding and tokinization/parsing
for chunk in input {
bytes.push_all(chunk.as_slice())
Expand Down
2 changes: 1 addition & 1 deletion src/components/util/time.rs
Expand Up @@ -200,7 +200,7 @@ impl Profiler {
if data_len > 0 {
let (mean, median, min, max) =
(data.iter().map(|&x|x).sum() / (data_len as f64),
data.get(data_len / 2).clone(),
*data.get(data_len / 2),
data.iter().fold(f64::INFINITY, |a, &b| a.min(b)),
data.iter().fold(-f64::INFINITY, |a, &b| a.max(b)));
println!("{:-35s}: {:15.4f} {:15.4f} {:15.4f} {:15.4f} {:15u}",
Expand Down

5 comments on commit 8b94a44

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from Ms2ger
at Ms2ger@8b94a44

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging Ms2ger/servo/rebased-vec = 8b94a44 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ms2ger/servo/rebased-vec = 8b94a44 merged ok, testing candidate = 67c9883

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 67c9883

Please sign in to comment.