Skip to content
Snippets Groups Projects
Commit aa07c6d2 authored by Geurtjens,D. (Douwe Geurtjens)'s avatar Geurtjens,D. (Douwe Geurtjens)
Browse files

Rename of function pdict to groupBy, filter dictionary fix.

parent bee9d9aa
No related branches found
No related tags found
1 merge request!1Big merge
......@@ -37,6 +37,7 @@ var reldone map[int]bool
var entdone map[int]bool
var funcdone map[int]bool
var relfuncdone map[int]bool
var filterDone map[int]bool
func search(JSONQuery *entity.IncomingQueryJSON, index int) {
listoflists = []pdictList{}
......@@ -44,7 +45,7 @@ func search(JSONQuery *entity.IncomingQueryJSON, index int) {
entdone = make(map[int]bool)
funcdone = make(map[int]bool)
relfuncdone = make(map[int]bool)
filterDone = make(map[int]bool)
var s pdictList
//printSlice(s)
//layercounter = 0
......@@ -215,7 +216,7 @@ func RelToAllFunc(JSONQuery *entity.IncomingQueryJSON, rel pdict) {
if _, ok := funcdone[i]; !ok {
if JSONQuery.GroupBys[i].RelationID == rel.pointer {
relfunc := pdict{
typename: "function",
typename: "groupBy",
pointer: i,
}
funcappliedtosubquery = append(funcappliedtosubquery, relfunc)
......@@ -224,7 +225,7 @@ func RelToAllFunc(JSONQuery *entity.IncomingQueryJSON, rel pdict) {
if JSONQuery.Relations[rel.pointer].FromID == i && JSONQuery.Relations[rel.pointer].FromType == "groupBy" {
fromfunc := pdict{
typename: "function",
typename: "groupBy",
pointer: i,
}
functowhichrelapplies = append(functowhichrelapplies, fromfunc)
......@@ -232,7 +233,7 @@ func RelToAllFunc(JSONQuery *entity.IncomingQueryJSON, rel pdict) {
} else if JSONQuery.Relations[rel.pointer].ToID == i && JSONQuery.Relations[rel.pointer].ToType == "groupBy" {
tofunc := pdict{
typename: "function",
typename: "groupBy",
pointer: i,
}
functowhichrelapplies = append(functowhichrelapplies, tofunc)
......@@ -393,9 +394,9 @@ func FuncToAllRel(JSONQuery *entity.IncomingQueryJSON, function pdict) {
}
func AddFilters(JSONQuery *entity.IncomingQueryJSON) {
filterDone := make([]bool, len(JSONQuery.Filters))
for i, filter := range JSONQuery.Filters {
if !filterDone[i] {
if _, ok := filterDone[i]; !ok {
p := pdict{
typename: filter.FromType,
pointer: filter.FromID,
......@@ -409,7 +410,7 @@ func AddFilters(JSONQuery *entity.IncomingQueryJSON) {
}
}
func addOneFilter(filterPDict pdict, JSONQuery *entity.IncomingQueryJSON, p pdict, filterDone *[]bool) {
func addOneFilter(filterPDict pdict, JSONQuery *entity.IncomingQueryJSON, p pdict, filterDone *map[int]bool) {
if p.typename == "filter" && (*filterDone)[p.pointer] {
l := FindCurrentLayer(listoflists, p)
k := pdictList{}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment