aboutsummaryrefslogtreecommitdiffstats
path: root/P1/src
diff options
context:
space:
mode:
authorMatt Strapp <strap012@umn.edu>2020-10-05 09:31:58 -0500
committerMatt Strapp <strap012@umn.edu>2020-10-05 09:31:58 -0500
commit50261fd0feed33ac769ec8f54ea2cd8b17192ba9 (patch)
tree74656e4f6c9678fc7e32a1a29bf0db47f8fb04fb /P1/src
parentFix mapper??????? (diff)
downloadcsci4061-50261fd0feed33ac769ec8f54ea2cd8b17192ba9.tar
csci4061-50261fd0feed33ac769ec8f54ea2cd8b17192ba9.tar.gz
csci4061-50261fd0feed33ac769ec8f54ea2cd8b17192ba9.tar.bz2
csci4061-50261fd0feed33ac769ec8f54ea2cd8b17192ba9.tar.lz
csci4061-50261fd0feed33ac769ec8f54ea2cd8b17192ba9.tar.xz
csci4061-50261fd0feed33ac769ec8f54ea2cd8b17192ba9.tar.zst
csci4061-50261fd0feed33ac769ec8f54ea2cd8b17192ba9.zip
Attempt to work on #5.
Blank files are made and free doesn't work still
Diffstat (limited to '')
-rw-r--r--P1/src/mapper.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/P1/src/mapper.c b/P1/src/mapper.c
index e430bb3..f234859 100644
--- a/P1/src/mapper.c
+++ b/P1/src/mapper.c
@@ -66,15 +66,15 @@ intermediateDS *insertPairToInterDS(intermediateDS *root, char *word, char *coun
// free the DS after usage. Call this once you are done with the writing of DS into file
void freeInterDS(intermediateDS *root) {
-if(root == NULL) return;
-
-intermediateDS *tempNode = NULL;
-while (root != NULL){
-tempNode = root;
-root = root -> next;
-freeValueList(tempNode -> value);
-free(tempNode);
-}
+ if(root == NULL) return;
+
+ intermediateDS *tempNode = NULL;
+ while (root != NULL){
+ tempNode = root;
+ root = root -> next;
+ freeValueList(tempNode -> value);
+ free(tempNode);
+ }
}
// emit the <key, value> into intermediate DS
@@ -121,7 +121,7 @@ void writeIntermediateDS() {
fclose(fptr);
tempNode = tempNode -> next;
}
- //freeInterDS(root);
+ freeInterDS(root);
}
int main(int argc, char *argv[]) {