@@ -97,41 +97,41 @@ export default ({
97
97
return true ;
98
98
}
99
99
100
- // for (let b = 0; b < 2; ++b) {
101
- // const loc = b === 0 ? 'h' : 'a';
102
- // const t = b === 0 ? h : a;
103
-
104
- // if (md <= 1) {
105
- // // is first two
106
- // if (c.locationByMatchday[`${t}:${1 - md}`] === loc) {
107
- // return true;
108
- // }
109
- // } else if (
110
- // md >= numMatchdays - 2 && // is last two
111
- // c.locationByMatchday[`${t}:${numMatchdays * 2 - 3 - md}`] === loc
112
- // ) {
113
- // return true;
114
- // }
115
-
116
- // if (md > 0 && md < numMatchdays - 1) {
117
- // const minus1 = c.locationByMatchday[`${t}:${md - 1}`];
118
- // const plus1 = c.locationByMatchday[`${t}:${md + 1}`];
119
- // if (minus1 === loc) {
120
- // if (plus1 === loc) {
121
- // return true;
122
- // }
123
- // const minus2 = c.locationByMatchday[`${t}:${md - 2}`];
124
- // if (minus2 === loc) {
125
- // return true;
126
- // }
127
- // } else if (plus1 === loc) {
128
- // const plus2 = c.locationByMatchday[`${t}:${md + 2}`];
129
- // if (plus2 === loc) {
130
- // return true;
131
- // }
132
- // }
133
- // }
134
- // }
100
+ for ( let b = 0 ; b < 2 ; ++ b ) {
101
+ const loc = b === 0 ? 'h' : 'a' ;
102
+ const t = b === 0 ? h : a ;
103
+
104
+ if ( md <= 1 ) {
105
+ // is first two
106
+ if ( c . locationByMatchday [ `${ t } :${ 1 - md } ` ] === loc ) {
107
+ return true ;
108
+ }
109
+ } else if (
110
+ md >= numMatchdays - 2 && // is last two
111
+ c . locationByMatchday [ `${ t } :${ numMatchdays * 2 - 3 - md } ` ] === loc
112
+ ) {
113
+ return true ;
114
+ }
115
+
116
+ if ( md > 0 && md < numMatchdays - 1 ) {
117
+ const minus1 = c . locationByMatchday [ `${ t } :${ md - 1 } ` ] ;
118
+ const plus1 = c . locationByMatchday [ `${ t } :${ md + 1 } ` ] ;
119
+ if ( minus1 === loc ) {
120
+ if ( plus1 === loc ) {
121
+ return true ;
122
+ }
123
+ const minus2 = c . locationByMatchday [ `${ t } :${ md - 2 } ` ] ;
124
+ if ( minus2 === loc ) {
125
+ return true ;
126
+ }
127
+ } else if ( plus1 === loc ) {
128
+ const plus2 = c . locationByMatchday [ `${ t } :${ md + 2 } ` ] ;
129
+ if ( plus2 === loc ) {
130
+ return true ;
131
+ }
132
+ }
133
+ }
134
+ }
135
135
136
136
return false ;
137
137
} ,
0 commit comments