open-consul/agent/submatview
Daniel Nephin 872bb9db14 submatview: avoid sorting results unnecessarily
Previous getFromView would call view.Result when the result may not have been returned
(because the index is updated past the minIndex. This would allocate a slice and sort it
for no reason, because the values would never be returned.

Fix this by re-ordering the operations in getFromView.

The test changes in this commit were an attempt to cover the case where
an update is received but the index does not exceed the minIndex.
2021-04-27 19:03:17 -04:00
..
handler.go submatview: remove method receiver from handlers 2020-10-06 13:22:02 -04:00
materializer.go submatview: avoid sorting results unnecessarily 2021-04-27 19:03:17 -04:00
store.go submatview: avoid sorting results unnecessarily 2021-04-27 19:03:17 -04:00
store_test.go submatview: avoid sorting results unnecessarily 2021-04-27 19:03:17 -04:00
streaming_test.go rpcclient:health: fix a data race and flake in tests 2021-04-27 19:03:17 -04:00