cfnptr / nets

Secure multi-platform networking library with implemented TCP / UDP / HTTP server and client
Apache License 2.0
4 stars 0 forks source link

Reduce code size #10

Open cfnptr opened 2 years ago

cfnptr commented 2 years ago

Reduce code size by writing variables in one line.

AnirudhParida commented 2 years ago

hello, i would like to work on this issue

cfnptr commented 2 years ago

Hello! I'm glad that you are interested in this project.

By reducing code, I mean rewriting vertically long functions and variables into one line. But no longer than the license at the beginning of each file.

Like this:

https://github.com/cfnptr/mpnw/blob/8b0ea1e57e52c318b72544492206e07b4ae6d6c7/source/http_client.c#L112-L115

And inlining function result into the if condition if it is not used after.

https://github.com/cfnptr/mpnw/blob/8b0ea1e57e52c318b72544492206e07b4ae6d6c7/source/socket.c#L82-L86

Thanks :)