![]() |
| | #1 |
| Super Moderator Join Date: Sep 2001
Posts: 4,746
| Eliminating Seperate Function in While Loop For my server program, I've written all the code, except for a few additional features (but the basics are there), and now I'm going through and just simplifying the code as much as possible. I've reduced a 12kb file into 39 lines of code. I could take that down even futher if I could figure out a way to do this. Right now, all the code for processing HTTP requests once they are recieved is handled by a single function, which makes separating HTTP from FTP very easy. The only problem is that in my HTTP code I have something like this: Code: while(mymethod() == true)
{
// Execute all this code
}
|
| sean is offline | |
| | #2 |
| Registered User Join Date: Apr 2002
Posts: 463
| could you post some of your surrounding code to help give context? |
| Draco is offline | |
| | #3 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,680
| Is there a point to this compression of the source code? Because you seem to have gone past simplification and into obfuscation. |
| Salem is offline | |
| | #4 |
| Registered User Join Date: Dec 2002
Posts: 546
| Contest perhaps? But yeah seeing additional code would make it a lot easier. |
| Frobozz is offline | |
| | #5 |
| Super Moderator Join Date: Sep 2001
Posts: 4,746
| I actually figured out a way to do it this morning. It's not so much compressing the code, but removing everything unnecessary. |
| sean is offline | |
| | #6 |
| Registered User Join Date: Dec 2002
Posts: 546
| Geez. From 12kb to 39 lines is removing unnecessary code? You should go do that to SharpDevelop. Maybe it'd speed up to usable. |
| Frobozz is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Either my loop is bad or my function is messed up | crazychile | C Programming | 25 | 11-02-2008 02:04 PM |
| Problem with Visual C++ Object-Oriented Programming Book. | GameGenie | C++ Programming | 9 | 08-29-2005 11:21 PM |
| Scope And Parameter Passing | djwicks | C Programming | 6 | 03-28-2005 08:26 PM |
| qt help | Unregistered | Linux Programming | 1 | 04-20-2002 09:51 AM |