Skip to content

Commit 10cf413

Browse files
authored
Merge pull request #82 from pepijndevos/patch-1
Use strict equality for comparing properties
2 parents 8e3e773 + 53825d9 commit 10cf413

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ConstructionBase"
22
uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
33
authors = ["Takafumi Arakaki", "Rafael Schouten", "Jan Weidner"]
4-
version = "1.5.4"
4+
version = "1.5.5"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/ConstructionBase.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ getproperties(o::Tuple) = o
5050

5151
if VERSION >= v"1.7"
5252
function check_properties_are_fields(obj)
53-
if propertynames(obj) != fieldnames(typeof(obj))
53+
# for ntuples of symbols `===` is semantically the same as `==`
54+
# but triple equals is easier for the compiler to optimize, see #82
55+
if propertynames(obj) !== fieldnames(typeof(obj))
5456
error("""
5557
The function `Base.propertynames` was overloaded for type `$(typeof(obj))`.
5658
Please make sure `ConstructionBase.setproperties` is also overloaded for this type.

0 commit comments

Comments
 (0)