[haiku-bugs] [Haiku] #10422: Optimize haiku\src\kits\network\libnetapi\NetworkAddress.cpp

  • From: "vinion" <trac@xxxxxxxxxxxx>
  • Date: Fri, 17 Jan 2014 18:56:56 -0000

#10422: Optimize haiku\src\kits\network\libnetapi\NetworkAddress.cpp
------------------------------+---------------------------
 Reporter:  vinion            |        Owner:  axeld
     Type:  enhancement       |       Status:  new
 Priority:  low               |    Milestone:  R1
Component:  Kits/Network Kit  |      Version:  R1/alpha4.1
 Keywords:                    |   Blocked By:
 Blocking:                    |  Has a Patch:  0
 Platform:  All               |
------------------------------+---------------------------
 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;
 }

--
Ticket URL: <http://dev.haiku-os.org/ticket/10422>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: