Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.
This repository was archived by the owner on Mar 14, 2023. It is now read-only.

Use hrw validation function to validate netmap normalization #33

Description

@alexvanin

With nspcc-dev/hrw#7 we can use normalization check before HRW sorting. Something like this in GetSelection()

	if ss[0].Key == NodesBucket {
		if len(b.nodes) < count {
			return nil
		}

		nodes := make(Nodes, len(b.nodes))
		copy(nodes, b.nodes)
		if len(pivot) != 0 {
			w := nodes.Weights()
			if hrw.ValidateWeights(w) != nil {
				return nil
			}
			hrw.SortSliceByWeightValue(nodes, w, pivotHash)
		}
		root.nodes = nodes[:count]
		return &root
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions