Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
1dc19de5
Commit
1dc19de5
authored
Dec 04, 2017
by
Janos Guljas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swarm/api: use path.Ext instead strings.LastIndex in MultiResolver.Resolve
parent
e451b65f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
api.go
swarm/api/api.go
+3
-2
No files found.
swarm/api/api.go
View file @
1dc19de5
...
...
@@ -21,6 +21,7 @@ import (
"fmt"
"io"
"net/http"
"path"
"regexp"
"strings"
"sync"
...
...
@@ -83,8 +84,8 @@ func NewMultiResolver(opts ...MultiResolverOption) (m *MultiResolver) {
// will be returned.
func
(
m
MultiResolver
)
Resolve
(
addr
string
)
(
h
common
.
Hash
,
err
error
)
{
rs
:=
m
.
resolvers
[
""
]
if
i
:=
strings
.
LastIndex
(
addr
,
"."
);
i
>=
0
{
rstld
,
ok
:=
m
.
resolvers
[
addr
[
i
+
1
:
]]
if
ext
:=
path
.
Ext
(
addr
);
ext
!=
""
{
rstld
,
ok
:=
m
.
resolvers
[
ext
[
1
:
]]
if
ok
{
rs
=
rstld
}
...
...
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