mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026448: Method Prepend() of sequence breaks it if argument is empty sequence
Check for empty input sequence added in methods Append() and Prepend() of TCollection and NCollection sequences. Test bugs fclasses bug26448 added
This commit is contained in:
@@ -67,6 +67,8 @@ void TCollection_BaseSequence::PAppend(const Standard_Address newnode)
|
||||
// ---------------------------------------------------
|
||||
void TCollection_BaseSequence::PAppend(TCollection_BaseSequence& Other)
|
||||
{
|
||||
if (Other.Size == 0)
|
||||
return;
|
||||
if (Size == 0) {
|
||||
Size = Other.Size;
|
||||
FirstItem = Other.FirstItem;
|
||||
@@ -104,6 +106,8 @@ void TCollection_BaseSequence::PPrepend(const Standard_Address newnode)
|
||||
|
||||
void TCollection_BaseSequence::PPrepend(TCollection_BaseSequence& Other)
|
||||
{
|
||||
if (Other.Size == 0)
|
||||
return;
|
||||
if (Size == 0) {
|
||||
Size = Other.Size;
|
||||
FirstItem = Other.FirstItem;
|
||||
|
Reference in New Issue
Block a user