File tree Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ extension RenderablePage
58
58
$0. href = " \( Site . Asset [ . main_css] ) "
59
59
$0. rel = . stylesheet
60
60
}
61
- if let canonical: String
61
+ if let canonical: String = canonical ?? location
62
62
{
63
63
$0 [ . link]
64
64
{
Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ extension WideQuery:VolumeLookupQuery
102
102
$0 [ let: symbol] = Output . Principal [ . master] / Volume. Vertex [ . symbol]
103
103
$0 [ let: hash] = Output . Principal [ . master] / Volume. Vertex [ . hash]
104
104
105
+ // ``namesOfLatest`` is always non-nil, so we don’t need to worry about
106
+ // degenerate index behavior.
105
107
$0 [ let: min] = Output . Principal [ . namesOfLatest] / Volume. Names [ . planes_min]
106
108
$0 [ let: max] = Output . Principal [ . namesOfLatest] / Volume. Names [ . planes_max]
107
109
}
Original file line number Diff line number Diff line change @@ -94,6 +94,13 @@ extension VolumeLookupQuery
94
94
$0 [ . replaceWith] = . init
95
95
{
96
96
$0 [ Self . names] = Mongo . Pipeline. ROOT
97
+
98
+ // ``Volume.Names`` is complex but not that large, and duplicating this
99
+ // makes the rest of the query a lot simpler.
100
+ if let names: Mongo . KeyPath = Self . namesOfLatest
101
+ {
102
+ $0 [ names] = Mongo . Pipeline. ROOT
103
+ }
97
104
}
98
105
}
99
106
Original file line number Diff line number Diff line change @@ -327,6 +327,10 @@ extension Volume.Vertex:BSONDocumentEncodable
327
327
bson [ . symbol] = self . symbol
328
328
329
329
case . meta( let self) :
330
+ // This must have a value, otherwise it would get lost among all the file
331
+ // vertices, and queries for it would be very slow.
332
+ bson [ . hash] = 0
333
+
330
334
bson [ . stem] = " "
331
335
bson [ . abi] = self . abi
332
336
bson [ . dependencies] = self . dependencies. isEmpty ? nil : self . dependencies
You can’t perform that action at this time.
0 commit comments