It wouldn't make the code cleaner - and it isn't a bottleneck now - especially since the Material::quantity is very cheap - it just returns a member var value.  I favor optimizing things that need optimizing.