Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
fix: use PropertySchemaID.Equal
Browse files Browse the repository at this point in the history
  • Loading branch information
rot1024 committed Aug 9, 2021
1 parent a4770ec commit 8a64591
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/infrastructure/fs/property_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (r *propertySchema) FindByID(ctx context.Context, i id.PropertySchemaID) (*
if ps == nil {
continue
}
if ps.ID() == i {
if ps.ID().Equal(i) {
return ps, nil
}
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/property/property.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func (p *Property) UnlinkAllByDataset(s id.DatasetSchemaID, ds id.DatasetID) {
}

func (p *Property) GetOrCreateField(ps *Schema, ptr *Pointer) (*Field, *GroupList, *Group, bool) {
if p == nil || ps == nil || ptr == nil || ps.ID() != p.Schema() {
if p == nil || ps == nil || ptr == nil || !ps.ID().Equal(p.Schema()) {
return nil, nil, nil, false
}

Expand All @@ -289,7 +289,7 @@ func (p *Property) GetOrCreateField(ps *Schema, ptr *Pointer) (*Field, *GroupLis
}

func (p *Property) GetOrCreateItem(ps *Schema, ptr *Pointer) (Item, *GroupList) {
if p == nil || ps == nil || ptr == nil || ps.ID() != p.Schema() {
if p == nil || ps == nil || ptr == nil || !ps.ID().Equal(p.Schema()) {
return nil, nil
}

Expand Down Expand Up @@ -320,7 +320,7 @@ func (p *Property) GetOrCreateItem(ps *Schema, ptr *Pointer) (Item, *GroupList)
}

func (p *Property) GetOrCreateGroup(ps *Schema, ptr *Pointer) (*Group, *GroupList) {
if p == nil || ps == nil || ptr == nil || ps.ID() != p.Schema() {
if p == nil || ps == nil || ptr == nil || !ps.ID().Equal(p.Schema()) {
return nil, nil
}

Expand All @@ -339,7 +339,7 @@ func (p *Property) GetOrCreateGroup(ps *Schema, ptr *Pointer) (*Group, *GroupLis
}

func (p *Property) GetOrCreateGroupList(ps *Schema, ptr *Pointer) *GroupList {
if p == nil || ps == nil || ptr == nil || ps.ID() != p.Schema() {
if p == nil || ps == nil || ptr == nil || !ps.ID().Equal(p.Schema()) {
return nil
}

Expand Down

0 comments on commit 8a64591

Please sign in to comment.