Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
de373ccd
Commit
de373ccd
authored
4 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Fix old hack for broken search_n in VC9...thats been fixed for years
parent
e1903b5c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llmessage/llmessagethrottle.cpp
+4
-25
4 additions, 25 deletions
indra/llmessage/llmessagethrottle.cpp
with
4 additions
and
25 deletions
indra/llmessage/llmessagethrottle.cpp
+
4
−
25
View file @
de373ccd
...
...
@@ -32,18 +32,8 @@
#include
"llframetimer.h"
// This is used for the stl search_n function.
#if _MSC_VER >= 1500 // VC9 has a bug in search_n
struct
eq_message_throttle_entry
:
public
std
::
binary_function
<
LLMessageThrottleEntry
,
LLMessageThrottleEntry
,
bool
>
{
bool
operator
()(
const
LLMessageThrottleEntry
&
a
,
const
LLMessageThrottleEntry
&
b
)
const
{
return
a
.
getHash
()
==
b
.
getHash
();
}
};
#else
bool
eq_message_throttle_entry
(
LLMessageThrottleEntry
a
,
LLMessageThrottleEntry
b
)
bool
eq_message_throttle_entry
(
const
LLMessageThrottleEntry
&
a
,
const
LLMessageThrottleEntry
&
b
)
{
return
a
.
getHash
()
==
b
.
getHash
();
}
#endif
const
U64
SEC_TO_USEC
=
1000000
;
...
...
@@ -118,14 +108,9 @@ BOOL LLMessageThrottle::addViewerAlert(const LLUUID& to, const std::string& mesg
LLMessageThrottleEntry
entry
(
hash
,
LLFrameTimer
::
getTotalTime
());
// Check if this message is already in the list.
#if _MSC_VER >= 1500 // VC9 has a bug in search_n
// SJB: This *should* work but has not been tested yet *TODO: Test!
message_list_iterator_t
found
=
std
::
find_if
(
message_list
->
begin
(),
message_list
->
end
(),
std
::
bind2nd
(
eq_message_throttle_entry
(),
entry
));
#else
message_list_iterator_t
found
=
std
::
search_n
(
message_list
->
begin
(),
message_list
->
end
(),
1
,
entry
,
eq_message_throttle_entry
);
#endif
message_list_iterator_t
found
=
std
::
search_n
(
message_list
->
begin
(),
message_list
->
end
(),
1
,
entry
,
eq_message_throttle_entry
);
if
(
found
==
message_list
->
end
())
{
// This message was not found. Add it to the list.
...
...
@@ -152,14 +137,8 @@ BOOL LLMessageThrottle::addAgentAlert(const LLUUID& agent, const LLUUID& task, c
LLMessageThrottleEntry
entry
(
hash
,
LLFrameTimer
::
getTotalTime
());
// Check if this message is already in the list.
#if _MSC_VER >= 1500 // VC9 has a bug in search_n
// SJB: This *should* work but has not been tested yet *TODO: Test!
message_list_iterator_t
found
=
std
::
find_if
(
message_list
->
begin
(),
message_list
->
end
(),
std
::
bind2nd
(
eq_message_throttle_entry
(),
entry
));
#else
message_list_iterator_t
found
=
std
::
search_n
(
message_list
->
begin
(),
message_list
->
end
(),
1
,
entry
,
eq_message_throttle_entry
);
#endif
if
(
found
==
message_list
->
end
())
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment