Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(775)

Unified Diff: Source/modules/accessibility/AXTable.cpp

Issue 991863003: Avoid unnecessary copies of AccessibilityChildrenVector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/accessibility/AXObjectCacheImpl.cpp ('k') | Source/modules/accessibility/AXTableColumn.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXTable.cpp
diff --git a/Source/modules/accessibility/AXTable.cpp b/Source/modules/accessibility/AXTable.cpp
index 41aae50fc82a9e476203fdfa5aa594cde9ef74a5..1a390131ba398c3b5da205d11c408e5669e9c62a 100644
--- a/Source/modules/accessibility/AXTable.cpp
+++ b/Source/modules/accessibility/AXTable.cpp
@@ -494,8 +494,7 @@ void AXTable::cells(AXObject::AccessibilityChildrenVector& cells)
int numRows = m_rows.size();
for (int row = 0; row < numRows; ++row) {
- AccessibilityChildrenVector rowChildren = m_rows[row]->children();
- cells.appendVector(rowChildren);
+ cells.appendVector(m_rows[row]->children());
}
}
@@ -522,7 +521,7 @@ AXTableCell* AXTable::cellForColumnAndRow(unsigned column, unsigned row)
// Iterate backwards through the rows in case the desired cell has a rowspan and exists in a previous row.
for (unsigned rowIndexCounter = row + 1; rowIndexCounter > 0; --rowIndexCounter) {
unsigned rowIndex = rowIndexCounter - 1;
- AccessibilityChildrenVector children = m_rows[rowIndex]->children();
+ const AccessibilityChildrenVector& children = m_rows[rowIndex]->children();
// Since some cells may have colspans, we have to check the actual range of each
// cell to determine which is the right one.
for (unsigned colIndexCounter = std::min(static_cast<unsigned>(children.size()), column + 1); colIndexCounter > 0; --colIndexCounter) {
« no previous file with comments | « Source/modules/accessibility/AXObjectCacheImpl.cpp ('k') | Source/modules/accessibility/AXTableColumn.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698