TFPGList.Extract does not return the correct value
Original Reporter info from Mantis: PascalDragon @PascalDragon
-
Reporter name: Sven Barth
Original Reporter info from Mantis: PascalDragon @PascalDragon
- Reporter name: Sven Barth
Description:
When calling a specialized TFPGList's Extract function for an entry that is in the list, but which is not the last one, the entry returned by Extract is equal to that of the next entry.
It works correctly when called for the last item in the list.
Steps to reproduce:
Attached is an example demonstrating the problem.
It specializes TFPGList for Integer and adds the values from 0 to 5 to the list. Then the First item is extracted until the list is empty (Output 1). As a second test the list is filled again with the above values and the items 2, 3 and 4 are extracted (Output 2).
For each extracted item the return value of Extract and the content of the list is printed.
The content of the list is correct, but the returned value of Extract is not.
Output 1 (without the list content):
Expected:
0
1
2
3
4
5
Actual:
1
2
3
4
5
5
Output 2 (without the list content):
Expected:
2
3
4
Actual:
3
4
5
Additional information:
If this is an error in trunk, then please merge the solution to 2.6 if possible.
Mantis conversion info:
- Mantis ID: 19960
- OS: Win64
- OS Build: NT 6.1 (7)
- Platform: x86_64
- Version: 2.4.4
- Fixed in version: 2.6.0
- Fixed in revision: 19018 (#a640bd0e)
- Monitored by: » @michaliskambi (Michalis Kamburelis)