-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race fix #2
Conversation
…opy with kamino lib
run_loop.go
Outdated
@@ -115,6 +118,14 @@ func (s *runLoop) run() { | |||
if msg == nil { | |||
continue | |||
} | |||
valMsg := reflect.ValueOf(msg) | |||
if valMsg.Kind() == reflect.Pointer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Чекать тип намного дешевле значения, там всё сводится к нескольким простым операциям на unsafe.Pointer reflect.TypeOf(msg).Kind() == reflect.Pointer
} | ||
for i := range inputs { | ||
input := inputs[i] | ||
for j := range input.outputPipelines { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Минор, но я бы избавился от i/j в пользу итерация по инпутам for _, inpit := range inpits {}
ради читаемости, мы эту штуку запускаем всего один раз при запуске, и на лишние копирования в принципе можем забить с чистой совестью)
No description provided.