From 97e620580253444f8fe3ffb87611b21a94e749cd Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Wed, 26 Mar 2025 19:55:39 +0000 Subject: [PATCH] GP-5522: Order LifeSet.spans() --- .../Emulation/src/main/java/generic/Span.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Ghidra/Framework/Emulation/src/main/java/generic/Span.java b/Ghidra/Framework/Emulation/src/main/java/generic/Span.java index 02093a9f2b..2be8cc7014 100644 --- a/Ghidra/Framework/Emulation/src/main/java/generic/Span.java +++ b/Ghidra/Framework/Emulation/src/main/java/generic/Span.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -411,7 +411,7 @@ public interface Span> extends Comparable { * * @return the set of spans */ - Set spans(); + NavigableSet spans(); /** * Get the values in this map @@ -563,7 +563,7 @@ public interface Span> extends Comparable { * * @return the iterable */ - Iterable spans(); + NavigableSet spans(); /** * Get a span which encloses all spans in the set @@ -862,9 +862,12 @@ public interface Span> extends Comparable { } @Override - public Set spans() { + public NavigableSet spans() { // TODO: Make this a view? - return spanTree.values().stream().map(e -> e.getKey()).collect(Collectors.toSet()); + return spanTree.values() + .stream() + .map(e -> e.getKey()) + .collect(Collectors.toCollection(TreeSet::new)); } @Override @@ -1027,7 +1030,7 @@ public interface Span> extends Comparable { } @Override - public Iterable spans() { + public NavigableSet spans() { return map.spans(); }