Removed the max/min family of functions (#28679)

They are in-built in Go now
```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2024-10-10 22:14:21 +05:30
коммит произвёл GitHub
родитель 4440ace6a9
Коммит 3db139f746
7 изменённых файлов: 5 добавлений и 40 удалений

Просмотреть файл

@@ -152,7 +152,7 @@ func NewLocalCacheLayer(baseStore store.Store, metrics einterfaces.MetricsInterf
DefaultExpiry: RoleCacheSec * time.Second,
InvalidateClusterEvent: model.ClusterEventInvalidateCacheForRoles,
Striped: true,
StripedBuckets: maxInt(runtime.NumCPU()-1, 1),
StripedBuckets: max(runtime.NumCPU()-1, 1),
}); err != nil {
return
}
@@ -336,7 +336,7 @@ func NewLocalCacheLayer(baseStore store.Store, metrics einterfaces.MetricsInterf
DefaultExpiry: UserProfileByIDSec * time.Second,
InvalidateClusterEvent: model.ClusterEventInvalidateCacheForProfileByIds,
Striped: true,
StripedBuckets: maxInt(runtime.NumCPU()-1, 1),
StripedBuckets: max(runtime.NumCPU()-1, 1),
}); err != nil {
return
}
@@ -394,13 +394,6 @@ func NewLocalCacheLayer(baseStore store.Store, metrics einterfaces.MetricsInterf
return
}
func maxInt(a, b int) int {
if a > b {
return a
}
return b
}
func (s LocalCacheStore) Reaction() store.ReactionStore {
return s.reaction
}

Просмотреть файл

@@ -818,7 +818,7 @@ func (s SqlSharedChannelStore) UpdateUserLastSyncAt(userID string, channelID str
return err
}
updateAt := maxInt64(user.UpdateAt, user.LastPictureUpdate)
updateAt := max(user.UpdateAt, user.LastPictureUpdate)
query := s.getQueryBuilder().
Update("SharedChannelUsers AS scu").

Просмотреть файл

@@ -192,13 +192,6 @@ func trimInput(input string) string {
return input
}
func maxInt64(a, b int64) int64 {
if a > b {
return a
}
return b
}
// Adds backtiks to the column name for MySQL, this is required if
// the column name is a reserved keyword.
//