xref: /aosp_15_r20/external/spdx-tools/spdxlib/element_ids.go (revision ba677afa8f67bb56cbc794f4d0e378e0da058e16)
1// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
2
3package spdxlib
4
5import (
6	"sort"
7
8	"github.com/spdx/tools-golang/spdx/common"
9)
10
11// SortElementIDs sorts and returns the given slice of ElementIDs
12func SortElementIDs(eIDs []common.ElementID) []common.ElementID {
13	sort.Slice(eIDs, func(i, j int) bool {
14		return eIDs[i] < eIDs[j]
15	})
16
17	return eIDs
18}
19