StringBuilder GetBuilder(YVisibility visibility, BuilderId.BuilderType type) { // Note: a lot of calls to 'new' var id = new BuilderId(visibility, type); if (_builders.ContainsKey(id)) { return(_builders[id]); } var builder = new StringBuilder(); _builders[id] = builder; return(builder); }
public bool Equals(BuilderId builderId) { return(builderId != null && builderId.visibility == visibility && builderId.type == type); }