mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Remove aggregate construction
This commit is contained in:
parent
3b8d9098c0
commit
ccaeb030f3
4 changed files with 5 additions and 72 deletions
|
|
@ -544,38 +544,4 @@ ROOT_BENCH("spring step", function()
|
|||
end)
|
||||
end)
|
||||
|
||||
TITLE "aggregate"
|
||||
|
||||
do
|
||||
-- the purpose of the two following benchmarks is to measure the overhead of
|
||||
-- aggregate construction
|
||||
ROOT_BENCH("set explicit vector", function()
|
||||
local apply = require "../src/apply"
|
||||
|
||||
local label = create "TextLabel" {
|
||||
AnchorPoint = vector.create(1, 1, 1)
|
||||
}
|
||||
|
||||
for i = 1, START(N) do
|
||||
apply(label, {
|
||||
AnchorPoint = vector.create(i, i, i)
|
||||
})
|
||||
end
|
||||
end)
|
||||
|
||||
ROOT_BENCH("set aggregate vector", function()
|
||||
local apply = require "../src/apply"
|
||||
|
||||
local label = create "TextLabel" {
|
||||
AnchorPoint = vector.create(1, 1, 1)
|
||||
}
|
||||
|
||||
for i = 1, START(N) do
|
||||
apply(label, {
|
||||
AnchorPoint = { i, i, i }
|
||||
})
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -759,21 +759,6 @@ TEST("create()", wrap_root(function()
|
|||
CHECK(text.Text == "test")
|
||||
end
|
||||
|
||||
do CASE "aggregate construction"
|
||||
local template = create "TextLabel" {
|
||||
AnchorPoint = Vector2.new(),
|
||||
Position = UDim2.new()
|
||||
}
|
||||
|
||||
local text = create(template) {
|
||||
AnchorPoint = { 1, 2 },
|
||||
Position = { 3, 4 }
|
||||
}
|
||||
|
||||
CHECK(text.AnchorPoint == Vector2.new(1, 2))
|
||||
CHECK(text.Position == UDim2.new(3, 4))
|
||||
end
|
||||
|
||||
do CASE "nested precedence"
|
||||
local text = create "TextLabel" {
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue