DASSL / ClassDB

An open-source system to let students experiment with relational data
https://dassl.github.io/ClassDB/
Other
7 stars 2 forks source link

Function ClassDB.isStudent has unnecessary code (E) #208

Closed smurthys closed 6 years ago

smurthys commented 6 years ago

Function ClassDB.isStudent (and 2 other functions) has the following unnecessary code which can be simplified (a possible rewrite is also shown):

IF NOT ClassDB.isUser($1) THEN
   RETURN FALSE;
ELSIF NOT ClassDB.isMember($1, 'classdb_student') THEN
   RETURN FALSE;
ELSE
   RETURN TRUE;
END IF;

The code can be simplified as follows:

IF NOT ClassDB.isUser($1) THEN
   RETURN FALSE;
ELSE
   RETURN ClassDB.isMember($1, 'classdb_student');
END IF;