Skip to content

Conversation

nervo
Copy link

@nervo nervo commented May 18, 2025

I've considered that it could be benefic to use native go boolean instead of emulate it with an integer like in c :)

Also:

  • introduce assertSpaceUnlocked method (same as cpAssertSpaceUnlocked in Chipmunk)
  • add a Space.IsLocked (same one in Chipmunk)

@nervo nervo force-pushed the space-locked-as-boolean branch from b500913 to 5b0958d Compare May 18, 2025 21:17
@nervo nervo mentioned this pull request May 18, 2025
@setanarut setanarut enabled auto-merge (squash) June 21, 2025 19:35
}

func (space *Space) Lock() {
space.locked++
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a behavioral change. With the int someone could be doing:

space.Lock()
space.Lock()
space.Unlock()
space.Unlock()

By changing to a boolean this will now error.

I'm not sure why this would matter but I want to keep close to the original source as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants