It seems strange how this dirties the layout even if nothing was changed (i.e. attrInfos[attrName] isn't defined). I would do and early return if it's not defined, or even throw an exception in debug mode (although this might be a normal thing to happen, I'm not sure).