Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sfu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alain Takoudjou
sfu
Commits
bbd5ce0c
Commit
bbd5ce0c
authored
Oct 03, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead code (cache.GetLast).
parent
28b7c6d5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
20 deletions
+0
-20
packetcache/packetcache.go
packetcache/packetcache.go
+0
-15
packetcache/packetcache_test.go
packetcache/packetcache_test.go
+0
-5
No files found.
packetcache/packetcache.go
View file @
bbd5ce0c
...
...
@@ -135,21 +135,6 @@ func (cache *Cache) Get(seqno uint16, result []byte) uint16 {
return
0
}
func
(
cache
*
Cache
)
GetLast
(
result
[]
byte
)
uint16
{
cache
.
mu
.
Lock
()
defer
cache
.
mu
.
Unlock
()
i
:=
cache
.
tail
-
1
if
i
>=
uint16
(
len
(
cache
.
entries
))
{
i
=
0
}
return
uint16
(
copy
(
result
[
:
cache
.
entries
[
i
]
.
length
],
cache
.
entries
[
i
]
.
buf
[
:
]),
)
}
func
(
cache
*
Cache
)
GetAt
(
seqno
uint16
,
index
uint16
,
result
[]
byte
)
uint16
{
cache
.
mu
.
Lock
()
defer
cache
.
mu
.
Unlock
()
...
...
packetcache/packetcache_test.go
View file @
bbd5ce0c
...
...
@@ -33,11 +33,6 @@ func TestCache(t *testing.T) {
if
!
bytes
.
Equal
(
buf
[
:
l
],
buf1
)
{
t
.
Errorf
(
"Couldn't get 13 at %v"
,
i1
)
}
l
=
cache
.
GetLast
(
buf
)
if
!
bytes
.
Equal
(
buf
[
:
l
],
buf2
)
{
t
.
Errorf
(
"Couldn't get last"
)
}
l
=
cache
.
Get
(
17
,
buf
)
if
!
bytes
.
Equal
(
buf
[
:
l
],
buf2
)
{
t
.
Errorf
(
"Couldn't get 17"
)
...
...
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