patchlwIP - A Lightweight TCP/IP stack - Patches: patch #9181, mdns: Remove unneeded slot...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9181: mdns: Remove unneeded slot variable from mdns_resp_add_service

Submitter:  Axel Lin <axellin>
Submitted:  Thu 01 Dec 2016 01:07:29 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Wont Do Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Planned Release:  None

Fri 02 Dec 2016 07:03:48 AM UTC, comment #4: 

Axel, I have to apologize, your patch is correct. Sorry for the confusion.

However, I don't like it, I consider the current code more readable than your version. "slot" is an indication that an empty slot was found. A compiler will optimize the additional variable away, so it won't affect runtime anyway.

Erik, if you think the patch is an improvement, feel free to apply it.

Dirk Ziegelmeier <dziegel>
Group administrator
Thu 01 Dec 2016 05:01:59 PM UTC, comment #3: 

Looks good to me.

Erik Ekman <yarrick>
Group Member
Thu 01 Dec 2016 02:32:22 PM UTC, comment #2: 

Hi Dirk,
I don't get it why slot is a bool variable?

int slot = -1;

In additional, I do run the test and it looks fine with this patch.

Axel Lin <axellin>
Group Member
Thu 01 Dec 2016 01:23:02 PM UTC, comment #1: 

No, this would break the code. "slot" is actually a "bool" variable indicating a free slot "mdns->services[slot] == NULL" was found.


Dirk Ziegelmeier <dziegel>
Group administrator
Thu 01 Dec 2016 01:07:29 PM UTC, original submission:  

Trivial clean up.

Axel Lin <axellin>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by yarrick (Posted a comment)
  • -email is unavailable- added by dziegel (Posted a comment)
  • -email is unavailable- added by axellin (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-12-01 dziegel StatusNone Wont Do
        Open/ClosedOpen Closed
    2016-12-01 axellin Attached File- Added 0001-mdns-Remove-unneeded-slot-variable-from-mdns_resp_ad.patch, #39127

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code