[Python-checkins] r42475 - python/trunk/PC/_winreg.c

Georg Brandl g.brandl at gmx.net
Sun Feb 19 00:44:43 CET 2006


Neal Norwitz wrote:
> On 2/18/06, georg.brandl <python-checkins at python.org> wrote:
>> Author: georg.brandl
>> Date: Sun Feb 19 00:35:11 2006
>> New Revision: 42475
>>
>> Modified:
>>    python/trunk/PC/_winreg.c
>> Log:
>> Patch #977553: speed up RegEnumKey call
>>
>>
>>
>> Modified: python/trunk/PC/_winreg.c
>> ==============================================================================
>> --- python/trunk/PC/_winreg.c   (original)
>> +++ python/trunk/PC/_winreg.c   Sun Feb 19 00:35:11 2006
>> @@ -1033,30 +1033,23 @@
>>         long rc;
>>         PyObject *retStr;
>>         char *retBuf;
>> -       DWORD len;
>> +       DWORD len = 256;  /* includes NULL terminator */
>> +       char tmpbuf[256]; /* max key name length is 255 */
> 
> These variables are related, right?  Can't this be:
> 
> +       char tmpbuf[256]; /* max key name length is 255 */
> +       DWORD len = sizeof(tmpbuf);  /* includes NULL terminator */
> 
> Then there's no worry if the size of tmpbuf changes.

Yes, of course. I changed it.

Thanks,
Georg



More information about the Python-checkins mailing list