Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cgen: fix autofree inserting string declarations for multiple functio…
…ns calls (#18723)
- Loading branch information
1 parent
e01d973
commit c48ae86
Showing
5 changed files
with
33 additions
and
3 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
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,13 @@ | ||
import strconv | ||
|
||
fn color_code_to_rgb(color string) []int { | ||
clr := color.replace('#', '') | ||
return [int(strconv.parse_int(clr[0..2], 16, 0) or { return [0, 0, 0] }), | ||
int(strconv.parse_int(clr[2..4], 16, 0) or { return [0, 0, 0] }), | ||
int(strconv.parse_int(clr[4..6], | ||
16, 0) or { return [0, 0, 0] })] | ||
} | ||
|
||
fn main() { | ||
dump(color_code_to_rgb('#abcdef')) | ||
} |
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