Skip to content

Commit

Permalink
Remove unnecessary assignment in style
Browse files Browse the repository at this point in the history
  • Loading branch information
sejongk committed Aug 25, 2023
1 parent 93e45fe commit 5862def
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/document/crdt/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ func (t *Tree) Style(from, to *TreePos, attributes map[string]string, editedAt *

err = t.traverseInPosRange(fromParent.Value, fromLeft.Value, toParent.Value, toLeft.Value,
func(node *TreeNode, contain index.TagContained) {
if !node.IsRemoved() && !node.IsText() {
if !node.IsRemoved() && !node.IsText() && len(attributes) > 0 {
if node.Attrs == nil {
node.Attrs = NewRHT()
}
Expand Down

1 comment on commit 5862def

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go Benchmark

Benchmark suite Current: 5862def Previous: 1deb19d Ratio
BenchmarkDocument/constructor_test - ns/op 1510 ns/op 1532 ns/op 0.99
BenchmarkDocument/constructor_test - B/op 984 B/op 984 B/op 1
BenchmarkDocument/constructor_test - allocs/op 16 allocs/op 16 allocs/op 1
BenchmarkDocument/status_test - ns/op 862.5 ns/op 869.4 ns/op 0.99
BenchmarkDocument/status_test - B/op 952 B/op 952 B/op 1
BenchmarkDocument/status_test - allocs/op 14 allocs/op 14 allocs/op 1
BenchmarkDocument/equals_test - ns/op 8368 ns/op 10937 ns/op 0.77
BenchmarkDocument/equals_test - B/op 6192 B/op 6192 B/op 1
BenchmarkDocument/equals_test - allocs/op 106 allocs/op 106 allocs/op 1
BenchmarkDocument/nested_update_test - ns/op 21429 ns/op 22029 ns/op 0.97
BenchmarkDocument/nested_update_test - B/op 11689 B/op 11689 B/op 1
BenchmarkDocument/nested_update_test - allocs/op 248 allocs/op 248 allocs/op 1
BenchmarkDocument/delete_test - ns/op 37464 ns/op 30122 ns/op 1.24
BenchmarkDocument/delete_test - B/op 14914 B/op 14915 B/op 1.00
BenchmarkDocument/delete_test - allocs/op 327 allocs/op 327 allocs/op 1
BenchmarkDocument/object_test - ns/op 10235 ns/op 11045 ns/op 0.93
BenchmarkDocument/object_test - B/op 6448 B/op 6448 B/op 1
BenchmarkDocument/object_test - allocs/op 110 allocs/op 110 allocs/op 1
BenchmarkDocument/array_test - ns/op 35528 ns/op 36927 ns/op 0.96
BenchmarkDocument/array_test - B/op 11545 B/op 11545 B/op 1
BenchmarkDocument/array_test - allocs/op 264 allocs/op 264 allocs/op 1
BenchmarkDocument/text_test - ns/op 39440 ns/op 39488 ns/op 1.00
BenchmarkDocument/text_test - B/op 14618 B/op 14617 B/op 1.00
BenchmarkDocument/text_test - allocs/op 470 allocs/op 470 allocs/op 1
BenchmarkDocument/text_composition_test - ns/op 39565 ns/op 39537 ns/op 1.00
BenchmarkDocument/text_composition_test - B/op 18002 B/op 18002 B/op 1
BenchmarkDocument/text_composition_test - allocs/op 471 allocs/op 471 allocs/op 1
BenchmarkDocument/rich_text_test - ns/op 105514 ns/op 115729 ns/op 0.91
BenchmarkDocument/rich_text_test - B/op 36815 B/op 36816 B/op 1.00
BenchmarkDocument/rich_text_test - allocs/op 1131 allocs/op 1131 allocs/op 1
BenchmarkDocument/counter_test - ns/op 21233 ns/op 22176 ns/op 0.96
BenchmarkDocument/counter_test - B/op 9969 B/op 9969 B/op 1
BenchmarkDocument/counter_test - allocs/op 235 allocs/op 235 allocs/op 1
BenchmarkDocument/text_edit_gc_100 - ns/op 4033579 ns/op 4135564 ns/op 0.98
BenchmarkDocument/text_edit_gc_100 - B/op 1552912 B/op 1553233 B/op 1.00
BenchmarkDocument/text_edit_gc_100 - allocs/op 17160 allocs/op 17162 allocs/op 1.00
BenchmarkDocument/text_edit_gc_1000 - ns/op 319842528 ns/op 324838368 ns/op 0.98
BenchmarkDocument/text_edit_gc_1000 - B/op 136654688 B/op 136659268 B/op 1.00
BenchmarkDocument/text_edit_gc_1000 - allocs/op 210818 allocs/op 210835 allocs/op 1.00
BenchmarkDocument/text_split_gc_100 - ns/op 4563140 ns/op 4743081 ns/op 0.96
BenchmarkDocument/text_split_gc_100 - B/op 2217788 B/op 2217902 B/op 1.00
BenchmarkDocument/text_split_gc_100 - allocs/op 16590 allocs/op 16590 allocs/op 1
BenchmarkDocument/text_split_gc_1000 - ns/op 369035097 ns/op 383612355 ns/op 0.96
BenchmarkDocument/text_split_gc_1000 - B/op 214884829 B/op 214858946 B/op 1.00
BenchmarkDocument/text_split_gc_1000 - allocs/op 211571 allocs/op 211421 allocs/op 1.00
BenchmarkDocument/text_delete_all_10000 - ns/op 19634710 ns/op 17286967 ns/op 1.14
BenchmarkDocument/text_delete_all_10000 - B/op 5903845 B/op 5904278 B/op 1.00
BenchmarkDocument/text_delete_all_10000 - allocs/op 41124 allocs/op 41126 allocs/op 1.00
BenchmarkDocument/text_delete_all_100000 - ns/op 252495602 ns/op 228813907 ns/op 1.10
BenchmarkDocument/text_delete_all_100000 - B/op 53849008 B/op 53849148 B/op 1.00
BenchmarkDocument/text_delete_all_100000 - allocs/op 415999 allocs/op 416029 allocs/op 1.00
BenchmarkDocument/text_100 - ns/op 318830 ns/op 315329 ns/op 1.01
BenchmarkDocument/text_100 - B/op 118213 B/op 118211 B/op 1.00
BenchmarkDocument/text_100 - allocs/op 5074 allocs/op 5074 allocs/op 1
BenchmarkDocument/text_1000 - ns/op 3524227 ns/op 3418509 ns/op 1.03
BenchmarkDocument/text_1000 - B/op 1152819 B/op 1152816 B/op 1.00
BenchmarkDocument/text_1000 - allocs/op 50078 allocs/op 50078 allocs/op 1
BenchmarkDocument/array_1000 - ns/op 1738169 ns/op 1762911 ns/op 0.99
BenchmarkDocument/array_1000 - B/op 1102653 B/op 1102668 B/op 1.00
BenchmarkDocument/array_1000 - allocs/op 11867 allocs/op 11867 allocs/op 1
BenchmarkDocument/array_10000 - ns/op 20520778 ns/op 19001813 ns/op 1.08
BenchmarkDocument/array_10000 - B/op 9906848 B/op 9908731 B/op 1.00
BenchmarkDocument/array_10000 - allocs/op 120718 allocs/op 120727 allocs/op 1.00
BenchmarkDocument/array_gc_100 - ns/op 187112 ns/op 183829 ns/op 1.02
BenchmarkDocument/array_gc_100 - B/op 98187 B/op 98163 B/op 1.00
BenchmarkDocument/array_gc_100 - allocs/op 1244 allocs/op 1243 allocs/op 1.00
BenchmarkDocument/array_gc_1000 - ns/op 2054870 ns/op 2010637 ns/op 1.02
BenchmarkDocument/array_gc_1000 - B/op 1170516 B/op 1170535 B/op 1.00
BenchmarkDocument/array_gc_1000 - allocs/op 12906 allocs/op 12907 allocs/op 1.00
BenchmarkDocument/counter_1000 - ns/op 293909 ns/op 284469 ns/op 1.03
BenchmarkDocument/counter_1000 - B/op 198532 B/op 198532 B/op 1
BenchmarkDocument/counter_1000 - allocs/op 6503 allocs/op 6503 allocs/op 1
BenchmarkDocument/counter_10000 - ns/op 3251910 ns/op 3017581 ns/op 1.08
BenchmarkDocument/counter_10000 - B/op 2165477 B/op 2165458 B/op 1.00
BenchmarkDocument/counter_10000 - allocs/op 69510 allocs/op 69510 allocs/op 1
BenchmarkDocument/object_1000 - ns/op 1900881 ns/op 1951429 ns/op 0.97
BenchmarkDocument/object_1000 - B/op 1451320 B/op 1451310 B/op 1.00
BenchmarkDocument/object_1000 - allocs/op 9915 allocs/op 9915 allocs/op 1
BenchmarkDocument/object_10000 - ns/op 22660321 ns/op 22760781 ns/op 1.00
BenchmarkDocument/object_10000 - B/op 12366080 B/op 12372457 B/op 1.00
BenchmarkDocument/object_10000 - allocs/op 101211 allocs/op 101229 allocs/op 1.00
BenchmarkRPC/client_to_server - ns/op 420398770 ns/op 389731391 ns/op 1.08
BenchmarkRPC/client_to_server - B/op 12251261 B/op 12242672 B/op 1.00
BenchmarkRPC/client_to_server - allocs/op 177142 allocs/op 177036 allocs/op 1.00
BenchmarkRPC/client_to_client_via_server - ns/op 727507812 ns/op 642045922 ns/op 1.13
BenchmarkRPC/client_to_client_via_server - B/op 22570364 B/op 22658348 B/op 1.00
BenchmarkRPC/client_to_client_via_server - allocs/op 330691 allocs/op 331639 allocs/op 1.00
BenchmarkRPC/attach_large_document - ns/op 1431141800 ns/op 1527324807 ns/op 0.94
BenchmarkRPC/attach_large_document - B/op 1800331424 B/op 1799383144 B/op 1.00
BenchmarkRPC/attach_large_document - allocs/op 9787 allocs/op 9624 allocs/op 1.02
BenchmarkRPC/adminCli_to_server - ns/op 612386784 ns/op 523263078 ns/op 1.17
BenchmarkRPC/adminCli_to_server - B/op 20390920 B/op 20394360 B/op 1.00
BenchmarkRPC/adminCli_to_server - allocs/op 321619 allocs/op 321620 allocs/op 1.00
BenchmarkLocker - ns/op 130.3 ns/op 117.5 ns/op 1.11
BenchmarkLocker - B/op 16 B/op 16 B/op 1
BenchmarkLocker - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkLockerParallel - ns/op 122.6 ns/op 114.5 ns/op 1.07
BenchmarkLockerParallel - B/op 0 B/op 0 B/op NaN
BenchmarkLockerParallel - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkLockerMoreKeys - ns/op 330.4 ns/op 317.6 ns/op 1.04
BenchmarkLockerMoreKeys - B/op 14 B/op 14 B/op 1
BenchmarkLockerMoreKeys - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkSync/memory_sync_10_test - ns/op 7334 ns/op 7248 ns/op 1.01
BenchmarkSync/memory_sync_10_test - B/op 1284 B/op 1286 B/op 1.00
BenchmarkSync/memory_sync_10_test - allocs/op 38 allocs/op 38 allocs/op 1
BenchmarkSync/memory_sync_100_test - ns/op 65706 ns/op 61335 ns/op 1.07
BenchmarkSync/memory_sync_100_test - B/op 8864 B/op 9086 B/op 0.98
BenchmarkSync/memory_sync_100_test - allocs/op 287 allocs/op 301 allocs/op 0.95
BenchmarkSync/memory_sync_1000_test - ns/op 684785 ns/op 645301 ns/op 1.06
BenchmarkSync/memory_sync_1000_test - B/op 81972 B/op 84099 B/op 0.97
BenchmarkSync/memory_sync_1000_test - allocs/op 2593 allocs/op 2731 allocs/op 0.95
BenchmarkSync/memory_sync_10000_test - ns/op 7096653 ns/op 7312902 ns/op 0.97
BenchmarkSync/memory_sync_10000_test - B/op 841519 B/op 867228 B/op 0.97
BenchmarkSync/memory_sync_10000_test - allocs/op 26625 allocs/op 27780 allocs/op 0.96
BenchmarkTextEditing - ns/op 27165872308 ns/op 25876054639 ns/op 1.05
BenchmarkTextEditing - B/op 8456905760 B/op 8456962672 B/op 1.00
BenchmarkTextEditing - allocs/op 20614217 allocs/op 20614639 allocs/op 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.