Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
vicotor
mybee
Commits
2d069305
Unverified
Commit
2d069305
authored
Jul 20, 2021
by
acud
Committed by
GitHub
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: remove dead code (#2338)
parent
c3f9dc19
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
33 deletions
+2
-33
mode_get.go
pkg/localstore/mode_get.go
+1
-9
mode_get_multi.go
pkg/localstore/mode_get_multi.go
+1
-8
mode_get_multi_test.go
pkg/localstore/mode_get_multi_test.go
+0
-12
store.go
pkg/storage/store.go
+0
-4
No files found.
pkg/localstore/mode_get.go
View file @
2d069305
...
...
@@ -68,16 +68,8 @@ func (db *DB) get(mode storage.ModeGet, addr swarm.Address) (out shed.Item, err
case
storage
.
ModeGetRequest
:
db
.
updateGCItems
(
out
)
case
storage
.
ModeGetPin
:
pinnedItem
,
err
:=
db
.
pinIndex
.
Get
(
item
)
if
err
!=
nil
{
return
out
,
err
}
return
pinnedItem
,
nil
// no updates to indexes
case
storage
.
ModeGetSync
:
case
storage
.
ModeGetLookup
:
case
storage
.
ModeGetSync
,
storage
.
ModeGetLookup
:
default
:
return
out
,
ErrInvalidMode
}
...
...
pkg/localstore/mode_get_multi.go
View file @
2d069305
...
...
@@ -75,15 +75,8 @@ func (db *DB) getMulti(mode storage.ModeGet, addrs ...swarm.Address) (out []shed
case
storage
.
ModeGetRequest
:
db
.
updateGCItems
(
out
...
)
case
storage
.
ModeGetPin
:
err
:=
db
.
pinIndex
.
Fill
(
out
)
if
err
!=
nil
{
return
nil
,
err
}
// no updates to indexes
case
storage
.
ModeGetSync
:
case
storage
.
ModeGetLookup
:
case
storage
.
ModeGetSync
,
storage
.
ModeGetLookup
:
default
:
return
out
,
ErrInvalidMode
}
...
...
pkg/localstore/mode_get_multi_test.go
View file @
2d069305
...
...
@@ -34,7 +34,6 @@ func TestModeGetMulti(t *testing.T) {
storage
.
ModeGetRequest
,
storage
.
ModeGetSync
,
storage
.
ModeGetLookup
,
storage
.
ModeGetPin
,
}
{
t
.
Run
(
mode
.
String
(),
func
(
t
*
testing
.
T
)
{
db
:=
newTestDB
(
t
,
nil
)
...
...
@@ -46,17 +45,6 @@ func TestModeGetMulti(t *testing.T) {
t
.
Fatal
(
err
)
}
if
mode
==
storage
.
ModeGetPin
{
// pin chunks so that it is not returned as not found by pinIndex
for
i
,
ch
:=
range
chunks
{
err
:=
db
.
Set
(
context
.
Background
(),
storage
.
ModeSetPin
,
ch
.
Address
())
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
chunks
[
i
]
=
ch
}
}
addrs
:=
chunkAddresses
(
chunks
)
got
,
err
:=
db
.
GetMulti
(
context
.
Background
(),
mode
,
addrs
...
)
...
...
pkg/storage/store.go
View file @
2d069305
...
...
@@ -33,8 +33,6 @@ func (m ModeGet) String() string {
return
"Sync"
case
ModeGetLookup
:
return
"Lookup"
case
ModeGetPin
:
return
"PinLookup"
case
ModeGetRequestPin
:
return
"RequestPin"
default
:
...
...
@@ -50,8 +48,6 @@ const (
ModeGetSync
// ModeGetLookup: when accessed to lookup a a chunk in feeds or other places
ModeGetLookup
// ModeGetPin: used when a pinned chunk is accessed
ModeGetPin
// ModeGetRequestPin represents request for retrieval of pinned chunk.
ModeGetRequestPin
)
...
...
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