Content-Length: 371051 | pFad | http://github.com/NativeScript/NativeScript/commit/a320ca1fb34c8ff61f5dec47d81d225c42abe41e

D2 revert: "perf(core): avoid setting the same value to view properties"… · NativeScript/NativeScript@a320ca1 · GitHub
Skip to content

Commit a320ca1

Browse files
authored
revert: "perf(core): avoid setting the same value to view properties" (#10618)
Revert "perf(core): avoid setting the same value to view properties (#10602)" This reverts commit 499fe8d.
1 parent e92ef33 commit a320ca1

File tree

1 file changed

+9
-26
lines changed

1 file changed

+9
-26
lines changed

packages/core/ui/styling/style-scope.ts

+9-26
Original file line numberDiff line numberDiff line change
@@ -721,40 +721,25 @@ export class CssState {
721721
cssExpsProperties[property] = value;
722722
continue;
723723
}
724-
725-
if (property in oldProperties) {
726-
const oldValue = oldProperties[property];
727-
728-
delete oldProperties[property];
729-
730-
if (oldValue === value) {
731-
// Skip unchanged values
732-
continue;
733-
}
724+
delete oldProperties[property];
725+
if (property in oldProperties && oldProperties[property] === value) {
726+
// Skip unchanged values
727+
continue;
734728
}
735-
736729
if (isCssVariable(property)) {
737730
view.style.setScopedCssVariable(property, value);
738731
delete newPropertyValues[property];
739732
continue;
740733
}
741-
742734
valuesToApply[property] = value;
743735
}
744-
745-
// we need to parse CSS vars first before evaluating css expressions
736+
//we need to parse CSS vars first before evaluating css expressions
746737
for (const property in cssExpsProperties) {
738+
delete oldProperties[property];
747739
const value = evaluateCssExpressions(view, property, cssExpsProperties[property]);
748-
749-
if (property in oldProperties) {
750-
const oldValue = oldProperties[property];
751-
752-
delete oldProperties[property];
753-
754-
if (oldValue === value) {
755-
// Skip unchanged values
756-
continue;
757-
}
740+
if (property in oldProperties && oldProperties[property] === value) {
741+
// Skip unchanged values
742+
continue;
758743
}
759744
if (value === unsetValue) {
760745
delete newPropertyValues[property];
@@ -776,11 +761,9 @@ export class CssState {
776761
view[camelCasedProperty] = unsetValue;
777762
}
778763
}
779-
780764
// Set new values to the style
781765
for (const property in valuesToApply) {
782766
const value = valuesToApply[property];
783-
784767
try {
785768
if (property in view.style) {
786769
view.style[`css:${property}`] = value;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NativeScript/NativeScript/commit/a320ca1fb34c8ff61f5dec47d81d225c42abe41e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy