From 40b9d78a34513224770758abea47bdda213bbfb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 21 Dec 2017 04:07:28 +0100 Subject: [PATCH] style: Remove needless and bogus bounds-check. The check should read index >= self.len(). But it doesn't matter anyway since we're covered by Rust's bound checks by default anyway. --- .../style/gecko_bindings/sugar/ns_style_auto_array.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/components/style/gecko_bindings/sugar/ns_style_auto_array.rs b/components/style/gecko_bindings/sugar/ns_style_auto_array.rs index be1a20c570f..512b2138df0 100644 --- a/components/style/gecko_bindings/sugar/ns_style_auto_array.rs +++ b/components/style/gecko_bindings/sugar/ns_style_auto_array.rs @@ -15,9 +15,6 @@ use std::slice::{Iter, IterMut}; impl Index for nsStyleAutoArray { type Output = T; fn index(&self, index: usize) -> &T { - if index > self.len() { - panic!("out of range") - } match index { 0 => &self.mFirstElement, _ => &self.mOtherElements[index - 1], @@ -27,9 +24,6 @@ impl Index for nsStyleAutoArray { impl IndexMut for nsStyleAutoArray { fn index_mut(&mut self, index: usize) -> &mut T { - if index > self.len() { - panic!("out of range") - } match index { 0 => &mut self.mFirstElement, _ => &mut self.mOtherElements[index - 1],