From aea05a29c94830176499680956e48ecb2d42381b Mon Sep 17 00:00:00 2001
From: George Hazan <george.hazan@gmail.com>
Date: Fri, 15 Jun 2012 07:30:21 +0000
Subject: MirandaPluginInterfaces is not needed anymore in the common case

git-svn-id: http://svn.miranda-ng.org/main/trunk@423 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
---
 src/modules/plugins/newplugins.cpp | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

(limited to 'src/modules')

diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index 022120379a..2f67ab297f 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -174,16 +174,20 @@ static int equalUUID(const MUUID& u1, const MUUID& u2)
 static MUUID miid_last = MIID_LAST;
 static MUUID miid_servicemode = MIID_SERVICEMODE;
 
-static int validInterfaceList(Miranda_Plugin_Interfaces ifaceProc)
+static bool validInterfaceList(Miranda_Plugin_Interfaces ifaceProc)
 {
-	MUUID *piface = ( ifaceProc ) ? ifaceProc() : NULL;
-	int i = 0/*, j*/;
+	// we don't need'em anymore in the common case
+	if (ifaceProc == NULL)
+		return true;
 
-	if (!piface)
-		return 0;
-	if (equalUUID(miid_last, piface[0]))
-		return 0;
-	return 1;
+	MUUID *piface = ifaceProc();
+	if (piface == NULL)
+		return false;
+
+	if ( equalUUID(miid_last, piface[0]))
+		return false;
+
+	return true;
 }
 
 static int isPluginBanned(MUUID u1, DWORD dwVersion)
@@ -282,7 +286,7 @@ static int checkAPI(TCHAR* plugin, BASIC_PLUGIN_INFO* bpi, DWORD mirandaVersion,
 	bpi->Interfaces = (Miranda_Plugin_Interfaces) GetProcAddress(h, "MirandaPluginInterfaces");
 
 	// if they were present
-	if ( !bpi->Load || !bpi->Unload || !bpi->InfoEx || !bpi->Interfaces ) {
+	if ( !bpi->Load || !bpi->Unload || !bpi->InfoEx) {
 LBL_Error:
 		FreeLibrary(h);
 		return 0;
-- 
cgit v1.2.3