refactor(ivy): moved wrapped reference to 0 position in array (#28947)
`LView`, `LContainer`, `StylingContext` are all arrays which wrap either an `HTMLElement`, `LView`, `LContainer`, `StylingContext`. It is often necessary to retrieve the correct type of element from the location which means that we often have to wrap the arrays. Logically it makes more sense if the thing which we are wrapping is at `0` location. Also it may be more performant since data is more local which may result in more L2 cache hits in CPU. PR Close #28947
This commit is contained in:

committed by
Miško Hevery

parent
1930e8a072
commit
bd65f58784
@ -27,12 +27,12 @@ export function createEmptyStylingContext(
|
||||
initialStyles?: InitialStylingValues | null,
|
||||
initialClasses?: InitialStylingValues | null): StylingContext {
|
||||
const context: StylingContext = [
|
||||
element || null, // Element
|
||||
0, // MasterFlags
|
||||
[] as any, // DirectiveRefs (this gets filled below)
|
||||
initialStyles || [null, null], // InitialStyles
|
||||
initialClasses || [null, null], // InitialClasses
|
||||
[0, 0], // SinglePropOffsets
|
||||
element || null, // Element
|
||||
[0], // CachedMultiClassValue
|
||||
[0], // CachedMultiStyleValue
|
||||
null, // PlayerContext
|
||||
|
Reference in New Issue
Block a user