refactor: early-return in Shader.Location uniform cache lookup

This commit is contained in:
2026-06-01 13:38:54 +02:00
parent 8423b73dfd
commit 4fe552b8bd

View File

@@ -38,11 +38,9 @@ public sealed class Shader : IDisposable
private int Location(string name) private int Location(string name)
{ {
if (!this._uniforms.TryGetValue(name, out int location)) if (this._uniforms.TryGetValue(name, out int location)) return location;
{ location = GL.GetUniformLocation(this._handle, name);
location = GL.GetUniformLocation(this._handle, name); this._uniforms[name] = location;
this._uniforms[name] = location;
}
return location; return location;
} }