lkml.org 
[lkml]   [2010]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Btrfs: Remove useless condition
From
On Sun, Sep 12, 2010 at 6:56 AM, Jaswinder Singh Rajput
<jaswinderlinux@gmail.com> wrote:
> Hello,
>
> On Sun, Sep 12, 2010 at 5:59 PM, Johannes Weiner <hannes@cmpxchg.org> wrote:
>> On Sun, Sep 12, 2010 at 04:32:20PM +0530, Jaswinder Singh Rajput wrote:
>>>
>>> if (ret) is useless as it will be never NULL as in previous statement
>>> we are setting ret = prev for !ret
>>
>> If there is no match and no extent below the given file offset, `prev'
>> will be NULL as well, no?
>>
>> So the check is not useless, it prevents throwing out a cached success
>> in case of a lookup failure.
>>
>
> Got it !!
>

Wouldn't it be clearer and easier to read if prev was checked directly
instead of checking ret after it becomes the same as prev?


\
 
 \ /
  Last update: 2010-09-12 19:31    [W:0.039 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site