On Wed, Apr 4, 2012 at 8:22 PM, Vojtech Horky <[email protected]> wrote:
> I think that the function could be broken down even more but I admit I
> haven't look all that closely.

You are right, it could be broken in two smaller chunks.
Actually do_copy looks like the following:

do_copy()
{
  //some initializations here
   if (src_type == TYPE_FILE)
   {
      //Large code
   } else if (src_type == TYPE_DIR) {
      //Large code
   } else error;
}

It could be refactored in the following way:

do_copy()
{
  //some initializations here
   if (src_type == TYPE_FILE)
      do_copy_file();
   else if (src_type == TYPE_DIR)
      do_copy_dir();
   else error;
}

-- 
--------------------
Maurizio Lombardi

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel

Reply via email to