Remove check for negative length (#5120)
This commit is contained in:
parent
583b1b8429
commit
5a4648cdd6
7 changed files with 8 additions and 8 deletions
|
@ -134,7 +134,7 @@ func NewLabels(labels ...*Label) error {
|
|||
// If pass repoID as 0, then ORM will ignore limitation of repository
|
||||
// and can return arbitrary label with any valid ID.
|
||||
func getLabelInRepoByName(e Engine, repoID int64, labelName string) (*Label, error) {
|
||||
if len(labelName) <= 0 {
|
||||
if len(labelName) == 0 {
|
||||
return nil, ErrLabelNotExist{0, repoID}
|
||||
}
|
||||
|
||||
|
|
|
@ -677,7 +677,7 @@ func (env *accessibleReposEnv) Repos(page, pageSize int) ([]*Repository, error)
|
|||
}
|
||||
|
||||
repos := make([]*Repository, 0, len(repoIDs))
|
||||
if len(repoIDs) <= 0 {
|
||||
if len(repoIDs) == 0 {
|
||||
return repos, nil
|
||||
}
|
||||
|
||||
|
@ -705,7 +705,7 @@ func (env *accessibleReposEnv) MirrorRepos() ([]*Repository, error) {
|
|||
}
|
||||
|
||||
repos := make([]*Repository, 0, len(repoIDs))
|
||||
if len(repoIDs) <= 0 {
|
||||
if len(repoIDs) == 0 {
|
||||
return repos, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -376,7 +376,7 @@ func calcFingerprint(publicKeyContent string) (string, error) {
|
|||
}
|
||||
|
||||
func addKey(e Engine, key *PublicKey) (err error) {
|
||||
if len(key.Fingerprint) <= 0 {
|
||||
if len(key.Fingerprint) == 0 {
|
||||
key.Fingerprint, err = calcFingerprint(key.Content)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue