[MERGE][bug #297831] don't call chdir('')

Aaron Bentley aaron at aaronbentley.com
Wed Nov 19 17:51:21 GMT 2008


John Arbash Meinel wrote:
> Aaron Bentley wrote:
>> Aaron Bentley has voted tweak.
>> Status is now: Conditionally approved
>> Comment:
>> Please change the test to if path != "" and -1 == chdir(path)
> 
>> For details, see:
>> http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C49244692.4050507%40arbash-meinel.com%3E
> 
>> Project: Bazaar
> 
> 
> 
> So I actually disagree with this, as "if path" can be translated into a
> very cheap "PyObject_True(path)" call, rather than having to create a
> temporary string object for "", and then call PyObject_Compare(path,
> tmp_obj).

If you can demonstrate that this has a significant impact on
performance, I'll let it in as-is.

Aaron



More information about the bazaar mailing list