Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
key-value-store
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Samarth Joshi
key-value-store
Commits
996cb357
Commit
996cb357
authored
Nov 09, 2020
by
Shivaji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change in remove_queue method
parent
0691e504
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
LRU.c
LRU.c
+12
-5
No files found.
LRU.c
View file @
996cb357
...
@@ -25,16 +25,23 @@ void remove_element_from_deque(char *key)
...
@@ -25,16 +25,23 @@ void remove_element_from_deque(char *key)
queue
*
present
=
qu
,
*
previous
=
NULL
;
queue
*
present
=
qu
,
*
previous
=
NULL
;
if
(
present
==
NULL
)
if
(
present
==
NULL
)
return
;
return
;
if
(
strcmp
(
present
->
key
,
key
)
==
0
)
{
qu
=
qu
->
next
;
if
(
last
==
present
)
last
=
last
->
next
;
free
(
present
);
return
;
}
while
(
present
->
next
!=
NULL
)
while
(
present
->
next
!=
NULL
)
{
{
if
(
present
->
key
==
key
)
if
(
strcmp
(
present
->
key
,
key
)
==
0
)
{
{
if
(
previous
==
NULL
)
qu
=
qu
->
next
;
if
(
last
==
present
)
if
(
last
==
present
)
last
=
previous
;
last
=
previous
;
if
(
previous
)
previous
->
next
=
present
->
next
;
previous
->
next
=
present
->
next
;
free
(
present
);
free
(
present
);
return
;
return
;
}
}
...
...
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