From 14a97090bfe28bd19e7c5176f3e68242ec27c9a0 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Thu, 18 Apr 2024 19:24:32 +0200 Subject: [PATCH] LSO no longer returns -1 for llListFindList([], []) --- lslopt/lslbasefuncs.py | 5 ++--- unit_tests/lso.suite/listfindlist.out | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lslopt/lslbasefuncs.py b/lslopt/lslbasefuncs.py index 80412ea..d3e78e0 100644 --- a/lslopt/lslbasefuncs.py +++ b/lslopt/lslbasefuncs.py @@ -1522,9 +1522,8 @@ def llListFindList(lst, elems): if L2 > L1: return -1 # can't find a sublist longer than the original list if L2 == 0: - # empty list is always found at position 0 in Mono, - # and in LSO if the first list isn't empty - return -1 if lslcommon.LSO and L1 == 0 else 0 + # empty list is always found at position 0 + return 0 for i in xrange(L1-L2+1): for j in xrange(L2): e1 = lst[i+j] diff --git a/unit_tests/lso.suite/listfindlist.out b/unit_tests/lso.suite/listfindlist.out index cbe5883..a6efba8 100644 --- a/unit_tests/lso.suite/listfindlist.out +++ b/unit_tests/lso.suite/listfindlist.out @@ -1 +1 @@ -[-1, 0] \ No newline at end of file +[0, 0] \ No newline at end of file