Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
755f853c
Commit
755f853c
authored
Oct 28, 2019
by
Abseil Team
Committed by
vslashg
Oct 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Googletest export
Avoid temporary matcher instances. They are unnecessary and can be relatively more expensive than the rest of the algorithm. PiperOrigin-RevId: 277084853
parent
757d39a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+3
-1
No files found.
googlemock/include/gmock/gmock-matchers.h
View file @
755f853c
...
...
@@ -3028,12 +3028,14 @@ class UnorderedElementsAreMatcherImpl
element_printouts
->
clear
();
::
std
::
vector
<
char
>
did_match
;
size_t
num_elements
=
0
;
DummyMatchResultListener
dummy
;
for
(;
elem_first
!=
elem_last
;
++
num_elements
,
++
elem_first
)
{
if
(
listener
->
IsInterested
())
{
element_printouts
->
push_back
(
PrintToString
(
*
elem_first
));
}
for
(
size_t
irhs
=
0
;
irhs
!=
matchers_
.
size
();
++
irhs
)
{
did_match
.
push_back
(
Matches
(
matchers_
[
irhs
])(
*
elem_first
));
did_match
.
push_back
(
matchers_
[
irhs
].
MatchAndExplain
(
*
elem_first
,
&
dummy
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment