Don't attempt to hang a prefix string unnecessarily#545
Merged
JohnnyMorganz merged 8 commits intomainfrom Aug 21, 2022
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #545 +/- ##
=======================================
Coverage 97.80% 97.80%
=======================================
Files 14 14
Lines 5416 5422 +6
=======================================
+ Hits 5297 5303 +6
Misses 119 119
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
This comment was marked as outdated.
This comment was marked as outdated.
…ang-prefix-ignore-string
Contributor
Repo Comparison Testdiff --git ORI/roact/src/Config.lua ALT/roact/src/Config.lua
index d97c8dc..8d1b3d5 100644
--- ORI/roact/src/Config.lua
+++ ALT/roact/src/Config.lua
@@ -82,9 +82,11 @@ function Config:set(configValues)
-- Right now, all configuration values must be boolean.
if typeof(value) ~= "boolean" then
- local message = (
- "Invalid value %q (type %s) for global configuration key %q. Valid values are: true, false"
- ):format(tostring(value), typeof(value), tostring(key))
+ local message = ("Invalid value %q (type %s) for global configuration key %q. Valid values are: true, false"):format(
+ tostring(value),
+ typeof(value),
+ tostring(key)
+ )
error(message, 3)
end
diff --git ORI/luvit/tests/test-url.lua ALT/luvit/tests/test-url.lua
index 105e660..88a1867 100644
--- ORI/luvit/tests/test-url.lua
+++ ALT/luvit/tests/test-url.lua
@@ -86,7 +86,11 @@ local relativeTests = {
"https://u:p@h.com/p/a/t/h?s#hash2",
},
{ "http://example.com/b//c//d;p?q#blarg", "https://a/b/c/d", "https://a/b/c/d" },
- { "http://example.com/b//c//d;p?q#blarg", "http://u:p@h.com/p/a/t/h?s#hash2", "http://u:p@h.com/p/a/t/h?s#hash2" },
+ {
+ "http://example.com/b//c//d;p?q#blarg",
+ "http://u:p@h.com/p/a/t/h?s#hash2",
+ "http://u:p@h.com/p/a/t/h?s#hash2",
+ },
{ "/foo/bar/baz", "/../etc/passwd", "/etc/passwd" },
{ "http://localhost", "file://foo/Users", "file://foo/Users" },
-- from node
diff --git ORI/lit/commands/serve.lua ALT/lit/commands/serve.lua
index 38e6078..e453aa3 100644
--- ORI/lit/commands/serve.lua
+++ ALT/lit/commands/serve.lua
@@ -37,11 +37,10 @@ return function()
end
end)
- app.use(require("weblit-auto-headers"))
-.route({ method = "GET", path = "/snapshots" }, require("snapshots")).route(
- { method = "GET", path = "/stats" },
- require("stats")
- )
+ app
+ .use(require("weblit-auto-headers"))
+ .route({ method = "GET", path = "/snapshots" }, require("snapshots"))
+ .route({ method = "GET", path = "/stats" }, require("stats"))
-- Handle websocket clients
app.websocket({
diff --git ORI/lit/deps/ssh-rsa.lua ALT/lit/deps/ssh-rsa.lua
index 17bc6bf..ac1f3ae 100644
--- ORI/lit/deps/ssh-rsa.lua
+++ ALT/lit/deps/ssh-rsa.lua
@@ -45,25 +45,27 @@ do
function dec(data)
data = string.gsub(data, "[^" .. chars .. "=]", "")
return (
- data:gsub(".", function(x)
- if x == "=" then
- return ""
- end
- local r, f = "", (chars:find(x) - 1)
- for i = 6, 1, -1 do
- r = r .. (f % 2 ^ i - f % 2 ^ (i - 1) > 0 and "1" or "0")
- end
- return r
- end):gsub("%d%d%d?%d?%d?%d?%d?%d?", function(x)
- if #x ~= 8 then
- return ""
- end
- local c = 0
- for i = 1, 8 do
- c = c + (x:sub(i, i) == "1" and 2 ^ (8 - i) or 0)
- end
- return string.char(c)
- end)
+ data
+ :gsub(".", function(x)
+ if x == "=" then
+ return ""
+ end
+ local r, f = "", (chars:find(x) - 1)
+ for i = 6, 1, -1 do
+ r = r .. (f % 2 ^ i - f % 2 ^ (i - 1) > 0 and "1" or "0")
+ end
+ return r
+ end)
+ :gsub("%d%d%d?%d?%d?%d?%d?%d?", function(x)
+ if #x ~= 8 then
+ return ""
+ end
+ local c = 0
+ for i = 1, 8 do
+ c = c + (x:sub(i, i) == "1" and 2 ^ (8 - i) or 0)
+ end
+ return string.char(c)
+ end)
)
end
end
|
Owner
Author
|
@matthargett thoughts on the Roact diff? |
…ang-prefix-ignore-string
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #508