diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-08 01:01:10 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-08 01:01:10 +0000 |
commit | e97a1e65ad297ee79964750d2f53e2d52b43013d (patch) | |
tree | e37fb6e68640e35fdb1b9e822b7e9747b357c9ec /views/accelerator.cc | |
parent | f70bea44bd046b9e4082b92435badad2a1c6a684 (diff) | |
download | chromium_src-e97a1e65ad297ee79964750d2f53e2d52b43013d.zip chromium_src-e97a1e65ad297ee79964750d2f53e2d52b43013d.tar.gz chromium_src-e97a1e65ad297ee79964750d2f53e2d52b43013d.tar.bz2 |
views: Use vector<T>::operator[] instead of vector<T>::at in the remaining cases.
The implementation of vector<T>::at performs bounds checks and can through an
exception std::out_of_range if you try to access an element that is not present
in the array. That is less eficient and we don't want to through an exception
anyway.
BUG=None
TEST=None
R=pkasting@chromium.org,sky@chromium.org
Review URL: http://codereview.chromium.org/7125012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88254 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/accelerator.cc')
-rw-r--r-- | views/accelerator.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/views/accelerator.cc b/views/accelerator.cc index e9c9345..bf9b90b 100644 --- a/views/accelerator.cc +++ b/views/accelerator.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -111,7 +111,7 @@ string16 Accelerator::GetShortcutText() const { string16 shortcut_rtl; bool adjust_shortcut_for_rtl = false; if (base::i18n::IsRTL() && shortcut.length() == 1 && - !IsAsciiAlpha(shortcut.at(0)) && !IsAsciiDigit(shortcut.at(0))) { + !IsAsciiAlpha(shortcut[0]) && !IsAsciiDigit(shortcut[0])) { adjust_shortcut_for_rtl = true; shortcut_rtl.assign(shortcut); } |