aboutsummaryrefslogtreecommitdiff
path: root/spdxlib/element_ids.go
blob: f0c5ee001b654f209cf53d82d5951d7ea068d7ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later

package spdxlib

import (
	"github.com/spdx/tools-golang/spdx"
	"sort"
)

// SortElementIDs sorts and returns the given slice of ElementIDs
func SortElementIDs(eIDs []spdx.ElementID) []spdx.ElementID {
	sort.Slice(eIDs, func(i, j int) bool {
		return eIDs[i] < eIDs[j]
	})

	return eIDs
}