Opened 5 years ago

Closed 5 years ago

#10422 closed enhancement (invalid)

Optimize haiku\src\kits\network\libnetapi\NetworkAddress.cpp

Reported by: vinion Owned by: axeld
Priority: low Milestone: R1
Component: Kits/Network Kit Version: R1/alpha4.1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

The method

static uint8 from_hex(char hex) {

if (isdigit(hex))

return hex - '0';

return tolower(hex) - 'a' + 10;

}

can be replaced with

static uint8 from_hex(char hex) {

return isdigit(hex) ? hex - '0' : tolower(hex) - 'a' + 10;

}

Change History (1)

comment:1 Changed 5 years ago by anevilyak

Resolution: invalid
Status: newclosed

As stated in the other example, these aren't optimizations. Please stop.

Note: See TracTickets for help on using tickets.