Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Map URL to itself to prevent more work later
Browse files Browse the repository at this point in the history
  • Loading branch information
sdboyer committed Sep 6, 2017
1 parent 7ae2d01 commit 5ecd38e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/gps/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,12 @@ func (sc *sourceCoordinator) getSourceGatewayFor(ctx context.Context, id Project
// integrate it back into the main map.
sc.srcmut.Lock()
defer sc.srcmut.Unlock()
// Record the name -> URL mapping, even if it's a self-mapping.
// Record the name -> URL mapping, making sure that we also get the
// self-mapping.
sc.nameToURL[normalizedName] = url
if url != normalizedName {
sc.nameToURL[url] = url
}

if sa, has := sc.srcs[url]; has {
// URL already had an entry in the main map; use that as the result.
Expand Down

0 comments on commit 5ecd38e

Please sign in to comment.