This patch moves some member init into the class constructor initialisation
lists.
Rational: somewhat cleaner, better style, and considered to produce better
performance.
Note that I'm not exactly familiar with the patch submission project, or
how to respond to mailing list threads. So, I figured I would start with
something small.
diff --git a/src/amd/addrlib/core/addrobject.cpp
b/src/amd/addrlib/core/addrobject.cpp
index 369be8c..a5edc14 100644
--- a/src/amd/addrlib/core/addrobject.cpp
+++ b/src/amd/addrlib/core/addrobject.cpp
@@ -59,8 +59,8 @@ AddrObject::AddrObject()
***************************************************************************************************
*/
AddrObject::AddrObject(const AddrClient* pClient)
+ : m_client(*pClient)
{
- m_client = *pClient;
}
/**
diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp
index cb195b2..1101966 100644
--- a/src/compiler/glsl/ir.cpp
+++ b/src/compiler/glsl/ir.cpp
@@ -1399,10 +1399,8 @@ ir_swizzle::ir_swizzle(ir_rvalue *val, const
unsigned *comp,
}
ir_swizzle::ir_swizzle(ir_rvalue *val, ir_swizzle_mask mask)
- : ir_rvalue(ir_type_swizzle)
+ : ir_rvalue(ir_type_swizzle), val(val), mask(mask)
{
- this->val = val;
- this->mask = mask;
this->type = glsl_type::get_instance(val->type->base_type,
mask.num_components, 1);
}
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev