How does Bitcoin Gold difficulty adjustment work?


Bitcoin Gold claimed to have per-block difficulty adjustment, how does it work? I find this https://github.com/BTCGPU/BTCGPU/pull/151, but still don’t understand how it work by change some parameters.