mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
bug fixes
This commit is contained in:
3 files changed
+8
-7
No files matched your search
@@ -124,12 +124,12 @@ class MongoService {
|
||||
return [pageDocs, numPages, count];
|
||||
}
|
||||
|
||||
async ranked<T extends Record<string, any>>(cursor: FindCursor<T>, equ: (a: T, b: T) => boolean): Promise<[number, T][]> {
|
||||
async ranked<T extends Record<string, any>>(cursor: T[] | FindCursor<T>, equ: (a: T, b: T) => boolean): Promise<[number, T][]> {
|
||||
let last = null;
|
||||
let r = 0;
|
||||
let count = 0;
|
||||
const results = [];
|
||||
const docs = await cursor.toArray();
|
||||
const docs = cursor instanceof Array ? cursor : await cursor.toArray();
|
||||
for (const doc of docs) {
|
||||
if ((doc as any).unrank) {
|
||||
results.push([0, doc]);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
{% import "components/contest.html" as contest with context %}
|
||||
{% import "components/problem.html" as problem with context %}
|
||||
{% block content %}
|
||||
{{ set(UiContext, 'tdoc', tdoc) }}
|
||||
<div class="row">
|
||||
<div class="medium-9 columns">
|
||||
<div class="row">
|
||||
|
||||
Reference in new issue
Block a user