Improve ignoreAttrs implementation using const