V
Vic
Guest
Hi,
I'm currently checking out the MediaPortal code to get a hang of it and see if I can contribute with anything.
During my debugging session I noticed that the HomeWindow plugin calls ProcessPlugins three times in a row. It seemed to do exactly the same operations all three times as far as I could see. This potentially slows down startup of MediaPortal.
Look at line 92 in home\home.cs:
ProcessPlugins(ref plugins);
ProcessPlugins(ref plugins);
ProcessPlugins(ref plugins);
And a sidenote:
The method also uses "ref" for no particular reason. The "ref" keyword should only be used when you modify the supplied variable in the method that is being called and want to use the result in the calling method. This usually makes no sense when passing in an object, since it means that you overwrite the object reference with a reference to another object. In C# objects are always passed by reference and not by value.
Hope this clears things up.
Thanks for a great product!
I'm currently checking out the MediaPortal code to get a hang of it and see if I can contribute with anything.
During my debugging session I noticed that the HomeWindow plugin calls ProcessPlugins three times in a row. It seemed to do exactly the same operations all three times as far as I could see. This potentially slows down startup of MediaPortal.
Look at line 92 in home\home.cs:
ProcessPlugins(ref plugins);
ProcessPlugins(ref plugins);
ProcessPlugins(ref plugins);
And a sidenote:
The method also uses "ref" for no particular reason. The "ref" keyword should only be used when you modify the supplied variable in the method that is being called and want to use the result in the calling method. This usually makes no sense when passing in an object, since it means that you overwrite the object reference with a reference to another object. In C# objects are always passed by reference and not by value.
Hope this clears things up.
Thanks for a great product!