Skip to content

Commit

Permalink
Make Vector<T>::duplicate() const
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronfranke committed Jun 25, 2024
1 parent 6b281c0 commit 8a66e7e
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/templates/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Vector {
return search.bisect(ptrw(), size(), p_value, p_before);
}

Vector<T> duplicate() {
Vector<T> duplicate() const {
return *this;
}

Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedByteArray.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
[b]Note:[/b] Decompression is not guaranteed to work with data not compressed by Godot, for example if data compressed with the deflate compression mode lacks a checksum or header.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedByteArray" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedColorArray.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
Returns the number of times an element is in the array.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedColorArray" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedFloat32Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
[b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedFloat32Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedFloat64Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
[b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedFloat64Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedInt32Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
Returns the number of times an element is in the array.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedInt32Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedInt64Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
Returns the number of times an element is in the array.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedInt64Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedStringArray.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
Returns the number of times an element is in the array.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedStringArray" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedVector2Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
[b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedVector2Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedVector3Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
[b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedVector3Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedVector4Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
[b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedVector4Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
24 changes: 24 additions & 0 deletions misc/extension_api_validation/4.2-stable.expected
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,27 @@ GH-91382
Validate extension JSON: Error: Field 'classes/AudioStreamPlaybackPolyphonic/methods/play_stream/arguments': size changed value in new API, from 4 to 6.

Optional arguments added. Compatibility methods registered.


GH-79140
--------
Validate extension JSON: Error: Field 'builtin_classes/PackedByteArray/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedColorArray/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedFloat32Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedFloat64Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedInt32Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedInt64Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedStringArray/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedVector2Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedVector3Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedByteArray/methods/duplicate', from 32C526A8 to 0EC26674. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedColorArray/methods/duplicate', from 3C506BBD to B71B693D. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedFloat32Array/methods/duplicate', from 3189CE20 to D517D0F3. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedFloat64Array/methods/duplicate', from 3894A88D to 60FEC131. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedInt32Array/methods/duplicate', from 7714AAB9 to BC482404. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedInt64Array/methods/duplicate', from 8DA48760 to 74E6F928. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedStringArray/methods/duplicate', from B24A91B2 to 2C891259. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedVector2Array/methods/duplicate', from E054B15C to 62F74D55. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedVector3Array/methods/duplicate', from A42961E9 to F89F931C. This means that the function has changed and no compatibility function was provided.

Make Vector<T>::duplicate() const.

0 comments on commit 8a66e7e

Please sign in to comment.