E
Efim
Hi all,
Due to performance issue, I want to pevent execution of ToString() function
in the code like the following:
if(reporting_level & DEBUG_LEVEL)
log(reporting_level,string.Format("Event of type {1} arrived. Event data:
{2}.",event,obj.ToString()));
It is clear that in Format it can be used different parameters and not
always they should use ToString, thus it's problematically to use Object as
parameter in the wrapper function.
On the other hand,I don't want to add "if.." in hundreds lines of the code.
What the pattern can I use instead of macro to prevent ToString from
execution?
Thanks,
Efim
Due to performance issue, I want to pevent execution of ToString() function
in the code like the following:
if(reporting_level & DEBUG_LEVEL)
log(reporting_level,string.Format("Event of type {1} arrived. Event data:
{2}.",event,obj.ToString()));
It is clear that in Format it can be used different parameters and not
always they should use ToString, thus it's problematically to use Object as
parameter in the wrapper function.
On the other hand,I don't want to add "if.." in hundreds lines of the code.
What the pattern can I use instead of macro to prevent ToString from
execution?
Thanks,
Efim