Created
February 5, 2020 08:55
-
-
Save Varriount/8f4a9046e6fade3fff343bf8540d5aa2 to your computer and use it in GitHub Desktop.
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
proc copy[T](d: T): T = | |
when T is ref: | |
# return a new reference that is a copy (though not a deep copy) of T | |
else: | |
return d # regular object copy logic | |
proc processData[T](data: T): T = | |
result = copy(data) | |
sort(result) | |
trim(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment