Skip to content

rename update -> _updateInternal to discourage callers#230

Merged
davidkoski merged 1 commit intomainfrom
rename-update
Apr 30, 2025
Merged

rename update -> _updateInternal to discourage callers#230
davidkoski merged 1 commit intomainfrom
rename-update

Conversation

@davidkoski
Copy link
Collaborator

No description provided.

@davidkoski davidkoski requested a review from awni April 30, 2025 16:04

/// Replace the interior ctx (`mlx_array` pointer) with a new value by transferring ownership
@inline(__always)
func update(_ ctx: mlx_array) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was internal to the indexing code and takes a bare mlx_array. Only a single callers so I just moved the body there (it is already calling mlx-c code so this is IMHO less confusing)

///
/// Note: this is an implementation detail and only visible because of the need to call it from
/// other `mlx-swift` modules.
public func _updateInternal(_ array: MLXArray) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Rename and updated docs.

Copy link
Member

@awni awni left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!!

@davidkoski davidkoski merged commit abe1092 into main Apr 30, 2025
1 check passed
@davidkoski davidkoski deleted the rename-update branch April 30, 2025 16:21
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