Skip to content

Commit 79f9cdb

Browse files
committed
Remove unnecessary parameters
1 parent c206375 commit 79f9cdb

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

parser/professorParser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"go.mongodb.org/mongo-driver/bson/primitive"
1111
)
1212

13-
func parseProfessors(sectionId primitive.ObjectID, rowInfo map[string]*goquery.Selection, classInfo map[string]string) []primitive.ObjectID {
13+
func parseProfessors(sectionId primitive.ObjectID, rowInfo map[string]*goquery.Selection) []primitive.ObjectID {
1414
professorText := utils.TrimWhitespace(rowInfo["Instructor(s):"].Text())
1515
professorMatches := personRegexp.FindAllStringSubmatch(professorText, -1)
1616
var profRefs []primitive.ObjectID = make([]primitive.ObjectID, 0, len(professorMatches))

parser/sectionParser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func parseSection(rowInfo map[string]*goquery.Selection, classInfo map[string]st
5252
Section_number: sectionNumber,
5353
Course_reference: courseRef.Id,
5454
Academic_session: session,
55-
Professors: parseProfessors(id, rowInfo, classInfo),
55+
Professors: parseProfessors(id, rowInfo),
5656
Teaching_assistants: getTeachingAssistants(rowInfo),
5757
Internal_class_number: classNum,
5858
Instruction_mode: getInstructionMode(classInfo),

parser/validator_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ func testCourseReferenceFail(fail string, courseIx int, sectionIx int, t *testin
381381
var sectionID, originalID primitive.ObjectID // used to store IDs of modified sections
382382

383383
// Build the failed section map based on fail type
384-
if fail == "missing" {
384+
switch fail {
385+
case "missing":
385386
// Misses a section
386387
for i, section := range testSections {
387388
if sectionIx != i {
@@ -390,7 +391,7 @@ func testCourseReferenceFail(fail string, courseIx int, sectionIx int, t *testin
390391
sectionID = section.Id // Nonexistent ID referenced by course
391392
}
392393
}
393-
} else if fail == "modified" {
394+
case "modified":
394395
// One section doesn't reference to correct courses
395396
for i, section := range testSections {
396397
sectionMap[section.Id] = section

0 commit comments

Comments
 (0)