-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: copy/paste step resolves #7 * Rename Copy/Paste Params to Copy/Paste Step * Move sequencer helper functions to helper.go * Remove useless comment * Remove useless comment --------- Co-authored-by: Xavier Godart <[email protected]>
- Loading branch information
1 parent
20e5ae6
commit 0aa7a6e
Showing
5 changed files
with
130 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package sequencer | ||
|
||
// Helper functions for deep copying pointers | ||
func copyIntPtr(ptr *int) *int { | ||
if ptr == nil { | ||
return nil | ||
} | ||
copy := *ptr | ||
return © | ||
} | ||
|
||
func copyUint8Ptr(ptr *uint8) *uint8 { | ||
if ptr == nil { | ||
return nil | ||
} | ||
copy := *ptr | ||
return © | ||
} | ||
|
||
func copyUint8SlicePtr(ptr *[]uint8) *[]uint8 { | ||
if ptr == nil { | ||
return nil | ||
} | ||
copy := make([]uint8, len(*ptr)) | ||
for i, v := range *ptr { | ||
copy[i] = v | ||
} | ||
return © | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters