Skip to content

Commit 95747a5

Browse files
committed
Simplify some code and delete unused variables
Signed-off-by: Javi Fontan <[email protected]>
1 parent 4a14787 commit 95747a5

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

repositories.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,8 @@ func (i *RowRepoIter) nextRepository() error {
152152

153153
i.repository = repo
154154
err = i.implementation.InitRepository(*repo)
155-
if err != nil {
156-
return err
157-
}
158155

159-
return nil
156+
return err
160157
}
161158

162159
// Next gets the next row

repositories_test.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestRepositoryPoolBasic(t *testing.T) {
4545
require.Nil(repo.Repo)
4646
require.True(ok)
4747

48-
repo, ok = pool.GetPos(1)
48+
_, ok = pool.GetPos(1)
4949
require.False(ok)
5050

5151
gitRepo := &git.Repository{}
@@ -56,9 +56,9 @@ func TestRepositoryPoolBasic(t *testing.T) {
5656
require.Equal(gitRepo, repo.Repo)
5757
require.True(ok)
5858

59-
repo, ok = pool.GetPos(0)
59+
_, ok = pool.GetPos(0)
6060
require.True(ok)
61-
repo, ok = pool.GetPos(2)
61+
_, ok = pool.GetPos(2)
6262
require.False(ok)
6363
}
6464

@@ -148,11 +148,7 @@ func (d *testCommitIter) InitRepository(repo Repository) error {
148148

149149
func (d *testCommitIter) Next() (sql.Row, error) {
150150
_, err := d.iter.Next()
151-
if err != nil {
152-
return nil, err
153-
}
154-
155-
return nil, nil
151+
return nil, err
156152
}
157153

158154
func (d *testCommitIter) Close() error {

0 commit comments

Comments
 (0)