Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Richard Gobeille
EDuke32
Commits
a0a45f0d
Commit
a0a45f0d
authored
Mar 27, 2022
by
Richard Gobeille
Browse files
engine: fix potential crash in LRU, optimize branching
parent
b9e67132
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/build/include/lru.h
View file @
a0a45f0d
...
...
@@ -68,9 +68,9 @@ public:
m_head
=
-
1
;
else
if
(
m_count
<
Capacity
)
++
m_count
;
if
(
++
m_head
==
m_tail
|
|
m_tail
==
-
1
)
if
(
(
++
m_head
==
m_tail
)
|
(
m_tail
==
-
1
)
)
{
if
(
ResetItems
&
RF_FREE
)
if
((
m_tail
!=
-
1
)
&
(
(
ResetItems
&
RF_FREE
)
==
RF_FREE
))
Xfree
(
m_items
[
m_tail
]);
m_tail
=
(
m_tail
+
1
)
%
Capacity
;
}
...
...
Write
Preview
Supports
Markdown
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