mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-05 01:32:41 +02:00
define constants for option strings
this prevents extra allocations in ParseOptions and cleans up the code a bit, but doesn't actually improve performance in any meaningful way.
This commit is contained in:
parent
c79633735f
commit
0980ea64a0
2 changed files with 28 additions and 12 deletions
|
|
@ -32,6 +32,10 @@ func TestOptions_String(t *testing.T) {
|
|||
Options{1, 2, true, 90, true, true},
|
||||
"1x2,fit,r90,fv,fh",
|
||||
},
|
||||
{
|
||||
Options{0.15, 1.3, false, 45, false, false},
|
||||
"0.15x1.3,r45",
|
||||
},
|
||||
}
|
||||
|
||||
for i, tt := range tests {
|
||||
|
|
@ -48,6 +52,7 @@ func TestParseOptions(t *testing.T) {
|
|||
}{
|
||||
{"", emptyOptions},
|
||||
{"x", emptyOptions},
|
||||
{"r", emptyOptions},
|
||||
{"0", emptyOptions},
|
||||
{",,,,", emptyOptions},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue